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!

Grab Value of <SELECT>

Status
Not open for further replies.

PenguinHead

Programmer
Jan 5, 2007
18
US
I am attempting to grab the selected value from a <SELECT>...<OPTION> statement [DB generated] and pass that value along to the next page.

I cannot seem to grab the values while I am in the loop because it gives me all of them, not the one selected. I cannot grab it outside the loop because it's an EOF.

My Code

Do Until UserRecord.EOF %><option
value="<%Response.Write(UserRecord("church"))%>">
<%Response.Write(UserRecord("church"))%></option><%

%><Input type="Hidden" name="strChurch" value="%Response.Write(UserRecord("church"))%"><%

%><Input type="Hidden" name="strPath" value="%Response.Write(UserRecord("path"))%"><%

UserRecord.MoveNext
Loop

*I have read some of the other threads and they didn't answer my question. =)
 
If you just need to get the selected value on the next page, you just have to code that into the 'next' page.

Like this,

Page w/ form on it:

<select name="selName">
<option...>
</select>

Next Page:

Request.Form("selName")

...that's the value of the selected element on the previous page.

Make sense?
 
Yes, that makes perfect sense. I don't suppose it could have been simpler! =) Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top