Part 2: Form validation—make sure that what's submitted is right
The great news is, cformsII provides nifty, awesomely CSS styled, server-side validation already built-in and ready to go. You can see if I click on Submit on my form without filling out the required details, or an improperly formatted e-mail address, the form reloads showing me the fields that are incorrect.
But why wait until the user clicks on the Submit button? While server-side validation is essential and the only way to properly validate data, by adding in a little client-side validation, with jQuery, we can easily enhance and speed up the user's process by alerting them as they work through the form that they're missing details or have data improperly formatted.
Note
Why is server-side validation important?
Client-side validation with JavaScript and jQuery should never be relied on for data validation or to prevent improperly formatted information from being submitted and sent to the server. Users can always disable JavaScript...