Finally, the "Terms and Conditions" checkbox is validated.We want to the user to agree to our imaginary Terms and Conditions before they send the form, so we'll check to make sure they've clicked the checkbox: in any one of the above cases, if one or more of our checks fail, the form will not be sent to the server.
So if you select the second item in the drop down, a text field associated with that selection appears.
My issue is how to make that text field required, but only required based on drop down selection. I am writing a script that validates two select menus. I need to check that it is not "empty" and if not they are alpha characters with -, space and ' special characters and with a limit of 30 chars. @eyefly: I'm guessing you're using cgiemail to process your form on the server?
Our example is very simple as it only checks one field.
Let's expand this example with a more complex function that checks lots of form fields.