Codeigniter validating dates

posted by | Leave a comment

If your callback returns anything other than a boolean TRUE/FALSE it is assumed that the data is your newly processed form data.All of the native error messages are located in the following language file: in your error string, it will be replaced with the "human" name you used for your field when you set your rules.Note: You will generally want to use the prepping functions after the validation rules so if there is an error, the original data will be shown in the form. It's time to repopulate the form field with the submitted data.

In order to organize your rules into "sets" requires that you place them into "sub arrays".

If you use this approach you must name your array keys as indicated: Give it a try!

Submit your form without the proper data and you'll see new error messages that correspond to your new rules.

In the "callback" example above, the error message was set by passing the name of the function: See the Language Class page for more info regarding language files.

By default, the Form Validation class adds a paragraph tag () around each error message shown. Important Note: If you use an array as the name of a form field, you must supply it as an array to the function.

Consider the following example, showing two sets of rules.

Leave a Reply

tokyo adult sex dating service websites