I have added the client side validations on a form using jQuery’s validate() function and assigned rules and it shows the error messages in Red color below the respected fields. I want to show same error messages after performing server side validations done in PHP. Please help.
I have added the client side validations on a form using jQuery’s validate() function
Share
You’ll have to perform that logic with PHP, in a sense replicating all that jQuery’s
validate()plugin does. I generally run through a series of tests, and add errors to an array:Then, after all of my rules, I’ll decide whether or not to post the data or show the errors:
This is a format that has worked well for me.