I wanted to validate their selection to alert them if they forgot to select one of the values, or if they selected the "Other" choice from the select list but forgot to type the "Other" value in the provided text input field.
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.
There are two main methods for validating forms: (usually done using Java Script).
Server-side validation is more secure but often more tricky to code, whereas client-side (Java Script) validation is easier to do and quicker too (the browser doesn't have to connect to the server to validate the form, so the user finds out instantly if they've missed out that required field! In this tutorial we'll build a simple form with client-side Java Script validation.
Also,in your example if all fields are left blank and the form is submitted it only realizes "flight_num" is missing.
However on the phone number field, defined at c, I want to add another script that will pop up if the user doesn't enter a phone number at least 9 digits long.
In my html I have multiple forms (text inputs, radio buttons, check boxes and select) and one button.