Retrive the items in list box

A

Amit Shinde

I have multiple list box added to the asp page using <select> tag

I have added items in the list box using recrdset from Education table
Education table={educationid, educationname}

User can choose more than items from the list box. These items gets
added in the user table in field
"edu" seprated by commas.
When User wants to edit his information ...i want that the items in the
list box should be automatically selected which are present in "edu"
field.
Please help
Amit shinde
 
D

Dominique

dim strEdu
strEdu = field_value_in_db 'get it from ur recordset

function select_field(eID)
if instr(1, strEdu, eID) then
select_field = " selected"
end if
end function

call the function above when ur looping through the recordset to create the
list again...

do until rs.eof %>
<option value="<%=rs("educationid")%>"
<%=select_field(rs("educationid"))%>><%=rs("educationname")%></option>
<%
rs.movenext
loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top