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

sorting option boxses

Status
Not open for further replies.

caseye

IS-IT--Management
Feb 7, 2002
52
US
I am trying to sort an option box does anyone know haw to read the actual taxt and the value from the options[] Array..
 

document.formName.selectName.options.text

and

document.formName.selectName.options.value


to access an option being selected use this:
document.formName.selectName.selectedIndex

to get number of options in <select> use this:
document.formName.selectName.options.length
 
sorry, [ i ] was &quot;eaten&quot;...


document.formName.selectName.options[n].text

and

document.formName.selectName.options[n].value


to access an option being selected use this:
document.formName.selectName.selectedIndex

to get number of options in <select> use this:
document.formName.selectName.options.length
 
I have tried that

Here was the syntax I used

variable = document.form.selectbox.options[x]

but when i go to write the variable all that is displayed is object.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top