Further Information
And we're done! Now try putting through a test submission with one more of the fields entered incorrectly. You should be returned to the same page, with errors.
To style the errors, just set the CSS for the "error" class - or define your own class, style it, and doctor the PHP to use that class instead.
Further Information
- Check out the script's documentation for more information about the validation rules, and a downloadable example script that may help clarify how things work.
- See the JS Validation tutorial for information on how to add client-side validation to your form.
- See the Re-filling form fields using the API tutorial for an explanation of how to re-fill your form fields after the user fails server-side validation.