Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Validation error messages
  • Hello when I get an error message from a field validation, like with the "required" test, I get this bubble with message
    "Please fill out this field" Where is that string coming from? I cant find it. Thanks
    Chris
  • Hi
    Do you need to set custom message?
    For example you have code:
    $val->add_field('some_field', 'Test field', 'required');
    
    To set custom message you can do next:
    $val->set_message('required', ' The field :label is required, please type if');
    

    or RTFM http://docs.fuelphp.com/classes/validation/methods.html#/method_set_message
  • This sounds like the browser error message. If you have a browser that supports html5, the "required" field is set, and the field is empty, then the browser will generate that error message.
  • Yup. That is the message generated by Firefox in HTML5 mode and a field marked "required". If you don't want this on submit, add the "formnovalidate" attribute to the button. This is handy if you use submit buttons for operations like "cancel" or "back"...
  • ok thanks a lot!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion