Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Title for drop down boxes

Status
Not open for further replies.

webmast

Programmer
Dec 21, 2001
57
IN
hi,
I have a set of dropdown boxes each containg different set of values.For each of the drop down boxes i've given a choice like "Pick Range","Pick Assertion" which is actually a title for the drop down.When the drop arrow is clicked, "pick range" and "pick Assertion" should not be a option to chose. These are just titles for the boxes.Could any one please help me out with this.


Thanx in advance,

pri..

 
hi webmast,

I normally include this type of check in my form validation routine...just check to make sure that the selectedIndex of the drop down lists is not equal to zero.

function validate(oForm) {
if (oForm.mySel_1.selectedIndex == 0) {
alert("Please choose an option from list one.");
return false;
}
}

<form onsubmit=&quot;return validate(this);&quot;>
<select name=&quot;mySel_1&quot;>
<option>Choose one:</option>
<option>
etc...
</select>
</form>
======================================

if (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top