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

Iterate through select boxes for values

Status
Not open for further replies.

metsey

Programmer
Mar 2, 2001
49
US
In asp, is there a way to gather the values from a series of select boxes in a submitted form?
 
Not sure I understand what you're looking for. You just want the values from a series of select boxes? If so, just use the:

request.form("selectbox")

Or are you trying to iterate through a series of select boxes where you're simply putting in a series of records? If this is the case, the code is a little more difficult, but not much so. Please clarify.
 
Yes I have a series of select boxes that I need to grab the name of the select box and the value of it.
 
you can loop thru the request object and pull out the form item names and value
(form items start at position 1 not 0)
for i=1 to request.form.count
strValue = SI.Request.Form.Item(iCount) 'value
strName = SI.Request.Form.Key(iCount) 'name
...
next
 
you can loop thru the request object and pull out the form item names and value
(form items start at position 1 not 0)
for iCount=1 to request.form.count
strValue = SI.Request.Form.Item(iCount) 'value
strName = SI.Request.Form.Key(iCount) 'name
...
next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top