Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
09-05-2012, 05:08 AM #1
- Join Date
- Aug 2012
- Thanked 0 Times in 0 Posts
Please help me out...deadline is evening
Please help me to do validation for the drop down in using java script.
The drop down field is in the table of every row. And the rows are creating dynamically.
The requirement is the drop down field is mandatory.
09-05-2012, 01:38 PM #2
- Join Date
- Apr 2012
- St. Louis, MO
- Thanked 101 Times in 101 Posts
SELECT tags can be validated in two ways - by selectedIndex, or by the value of the selectedIndex. (Notice the capital "I".. it must be capitalized, or it won't work.)
If your form name is "formName" and the select is named "selectName":
if(document.forms["formName"].selectName.selectedIndex == 0) means "if the select is in the first position" (it's a zero-based index.)
if(document.forms["formName"].options[document.forms["formName"].selectedIndex].value == "") means "if the value of the current selection is blank".
If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".