General discussion

Locked

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.

bye,
Nise

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by Prem130373 In reply to Dynamically Adding Option ...

Hi,

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")%>
</option>
<%
ABC.MoveNext
loop
ABC.Close
%>
</select>

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

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums