We will have a HTML page which will contain the form, a CSS file, a .
The HTML form we will be working at in these chapters, contains various input fields: required and optional text fields, radio buttons, and a submit button: The validation rules for the form above are as follows: This code adds a script tag and an alert command.
And when the page loads, the Java Script code will be executed (the user will see an alert box).
For today’s tutorial we are going to do something a little more interesting and take several j Query functions, which have been covered in our previous posts and combine them to create our own form submit process, which will be able to handle all of the forms in our projects.
This is a good exercise to see how various components/snippets can be combined to create a complete function.
This is achieved by grouping together validation functions in "modules", making it possible to load only those functions that's needed to validate a particular form.