Code for validating login textbox in dating salesperson
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.
Let's build a simple form with a validation script.
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?
As an exercise, try modifying the script to only prompt the user one field at a time.
For example, if they miss out the "Name" and "Gender" fields and press "Send Details", it will only prompt them for the "Name" field initially.
Then, after they fill in the "Name" field and press "Send Details" again, it will prompt them for the "Gender" field.