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

update a list box from a dropdown when button clicked 1

Status
Not open for further replies.

idono

Technical User
Jan 16, 2002
71
0
0
US
Obviously I'm new. I have a dropdown box that is populated from a database. Now when I click a button I would like the selected to display in a listbox. This may be better handled with a multiselect, but I don't know how to do that either. The idea is to select multiple names and then pass it to the next page.

Any ideas?
 
Use a multiple select - this is what it was designed for!

Code:
<select multiple name=&quot;colour&quot; size=&quot;4&quot;>
  <option value=&quot;red&quot;>Red</option>
  <option value=&quot;blue&quot;>Blue</option>
  <option value=&quot;green&quot;>Green</option>
  <option value=&quot;yellow&quot;>Yellow</option>
</select>

On the receiving page, you will get a comma-delimited list in the Request.Form collection:

Code:
<%
cols = Request.Form(&quot;colour&quot;)
Response.Write cols
%>

Might result in this:

red, blue, yellow --James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top