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!

Scripting Dropdown innerHTML

Status
Not open for further replies.

NevG

Programmer
Oct 10, 2000
162
GB
Hi gang

can someone please tell me why I am not able to set the innerHTML of my dropdown select control using javascript

Im trying to change the contents of my second slect control from the choice in the first one using an XML string that has come back from end. When I format the xml into

<option></option> etc.... and set it to the innerhtml 2 things happen

1) the innerhtml of the control doesnt get set
2) the string Im trying to set the innerhtml from loses the opening <option> tag

choice1</option><option>choice2</option>

is what I end up with ...

help !!

Thanks

NG
 

As far as I know, you cannot populate a select control using innerHTML. You will have to use Javascript to add new Options to the control.

Hope this helps,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top