Then, after they fill in the "Name" field and press "Send Details" again, it will prompt them for the "Gender" field.
As a finishing touch, try making the script move the cursor to the field that needs filling in each time ( I'm hoping you can provide me with some guidance.
Form validation is the process of checking that a form has been filled in correctly before it is processed.
For example, if your form has a box for the user to type their email address, you might want your form handler to check that they've filled in their address before you deal with the rest of the form.
I have a dropdown selection list, and based on the selection, there are text fields that are hidden or displayed for more info.
Now you know how to write a form validation script that can handle multiple form fields, including text boxes, radio buttons, drop-down lists and check boxes!The form will include one text field called "Your Name", and a button.Our validation script will ensure that the user enters their name before the form is sent to the server. Try pressing the Send Details button without filling anything in the "Your Name" field.Shows you how to write a script that ensures your form is filled in correctly before it's sent to your server.Great for "required fields" such as email addresses!