I know there are ways to do this with radio buttons and checkboxes, but can it be done with dropdowns as well? Could you please give me an example of how to check them one at a time and how to concatonate the errors if they exist? The name of my form is "my Form"I have not been able to find code anywhere that incorporates the 2 (That is, empty or alpha). might help: Rather than using alert()s for each field, just concatenate the error messages together into a string (separated by e.g.
One point to note about Java Script validation is that it can always be circumvented by the user disabling Java Script in their browser, so for secure validation you'll need to write your validating code in your server-side scripts.
However, for day-to-day use Java Script is a quick and easy way to check over your forms before they're sent to your server.
Thanks, David[Edited by catron on 16-Feb-11 ] im having trouble with my student registration form.you choose the subjects BSIT, BSMATH, BSED, BEED.year level will be limited until 4 year only while if course is BSCE, BSGE, BSArch it will limit until 5 year.. [code]if ( document.contact_form.contact_name.value == "" ) [code]=space In your example if one enters    it does not trap it. It can be found at; Matt, I find your site very helpful. Validation is working when I test the forms but I am getting emails with 1 or -1 in fields (instead of a valid phone or email, etc.) AND I am getting 20, 40, 80 at one time.
Again, you might like to open the source code for this form in a separate window, so that you can refer to it as we talk you through.
Like our previous example, this page has a form called start at zero (for the first option).
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!
We'll also look at how to check other types of fields, such as checkboxes, radio buttons and drop-down lists.