General discussion


Dynamically Adding Options in <select>

By nise_k ·
Hi friends,

can u pls tell me how to Dynamically Add Options in the <Select>. I am using Netscape. I cud do it in IE, but not in Netscape.


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by Prem130373 In reply to Dynamically Adding Option ...


You can do this by using VB Script. If you are getting the data from the database to get the data then this will get you the options in <select>

--- Below code goes on the top of the page after connection is set to the database ----
set ABC = server.CreateObject("ADODB.Recordset")
sqlstr = "Select ID, Name from TempMaster"
ABC.Open sqlstr,conn

---- HTML Code for <Select> -------

<select name="TEST">
<option value="X">Select One</option>
do until getproject.EOF
<option value="<%=ABC("ID")%>"><%=ABC("Name")%>

I hope this will help.

Collapse -

by nise_k In reply to

Poster rated this answer.

Collapse -

by nise_k In reply to Dynamically Adding Option ...

This question was closed by the author

Related Discussions

Related Forums