|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi everyone,
I could really use some help on this little issue.. It's driving me MAD!! Ok I'm using an Access DB to get values for a drop down box and inside my DB I'm using two fields.. ID and Name. When I display my drop down box everything is cool.. but when I goto the next page and send an email I'm not getting the value I need.. Please see below.. Here is my Code Code:
Response.Write "<SELECT name=Test>"
Response.Write "<OPTION VALUE=0>Please select a test</OPTION>"
DO WHILE NOT oRS.EOF
Response.Write "<OPTION VALUE=" & oRS("ID") & ">" & oRS("testName") & "</OPTION>"
oRS.MoveNext
LOOP
Response.write "</SELECT>"
This is what the source looks like when you look at it after the server sends it to the browser.. Code:
<SELECT name=Test> <option value="0">TestName 1</option> <option value="1">TestName 2</option> <option value="2">TestName 3</option> </SELECT> My problem is that when I use standard Request.Form("test) to send the value via email I get a value of 1, 2, ect.. I need to send the name of the Test instead of the 0, 1, 2 Any ideas would be greatly appreciated.. Thanks in advance, Rich Last edited by richh : February 27th, 2003 at 11:49 AM. |
|
#2
|
|||
|
|||
|
So why not...?
Code:
<SELECT name=Test> <option value="TestName 1">TestName 1</option> <option value="TestName 2">TestName 2</option> <option value="TestName 3">TestName 3</option> </SELECT> Otherwise go back to your database to get the name. |
|
#3
|
|||
|
|||
|
numbernine ,
Thanks for the reply. So what your saying is use Code:
Response.Write "<SELECT name=Test>"
Response.Write "<OPTION VALUE=0>Please select a test</OPTION>"
DO WHILE NOT oRS.EOF
Response.Write "<OPTION VALUE=" & oRS("testName") & ">" & oRS("testName") & "</OPTION>"
oRS.MoveNext
LOOP
Response.write "</SELECT>"
What would be the code for going to the DB and getting it?? Response.Write testName doesn't work... Any Suggestions?? Rich Last edited by richh : February 27th, 2003 at 12:27 PM. |
|
#4
|
|||
|
|||
|
Hey Rich,
Yes--that's what I'm saying. This way you can use Request.Form("test") to get the infor you want. If you want to get the info from the database instead you would connect to the database in the same way you connected on the first page; only now your SQL Statement would look like: strSQL = "SELECT TestName FROM myTable WHERE ID = " & Request.Form("Test") Does this make sense? |
|
#5
|
|||
|
|||
|
Hey NumberNine,
Yep, perfect sense.. Thanks a million.. ![]() Take care, Rich ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > Need some quick help with returning values.. Please... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|