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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count the number of OPTIONS in a SELECT box.

Status
Not open for further replies.

BirdieNamNam

Programmer
Feb 12, 2004
52
0
0
SE
Hello dear friends!

I want to get the number of options from a SELECT box in a HTML form. Can I do this? I can't find the property anywhere. I have tried (the form's name is "config")

Code:
document.config.elements[i].size
document.config.elements[i].length
document.config.elements[i].options.lenght

, but I cannot seem to get it right.

Best regards, Sebastian.
 
Hehe... that was really the case. I had misspelled it in the code. Thanks for the correction! Now it works fine!

/Sebastian.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top