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

Can't change combo box value

Status
Not open for further replies.

shnaeem

Programmer
Apr 2, 2001
10
US
< HEAD><TITLE>Search Results</TITLE>
< /HEAD>
< BODY>

< form id = ff1>
<S ELECT id=select1 style=&quot;WIDTH: 128px&quot; name=select1>
< OPTION value=1
selected>1</OPTION>
< OPTION value=2>2</OPTION>
< OPTION value=3>3</OPTION>
< /SELECT>
< /FORM>

< script type=&quot;text/javascript&quot;>

document.ff1.select1.value = &quot;2&quot;;
< /script>
< /BODY>
< /HTML>

I using above code to change the combo box value dynamically. I need it as i am retrieving values from database and the combobox contains one of the field from db and it has to change. Please tell me how could i do that.
There must be a way to do this
 
The values are stored in the options array:

document.ff1.select1.options.value;

where i is some integer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top