ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 27th, 2003, 11:47 AM
richh richh is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Phoenix, AZ
Posts: 11 richh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Need some quick help with returning values.. Please...

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.

Reply With Quote
  #2  
Old February 27th, 2003, 12:06 PM
numbernine numbernine is offline
Up To His Eyes In Ads
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Chicago
Posts: 160 numbernine User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 25 sec
Reputation Power: 6
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.

Reply With Quote
  #3  
Old February 27th, 2003, 12:22 PM
richh richh is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Phoenix, AZ
Posts: 11 richh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #4  
Old February 27th, 2003, 02:10 PM
numbernine numbernine is offline
Up To His Eyes In Ads
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Chicago
Posts: 160 numbernine User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 25 sec
Reputation Power: 6
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?

Reply With Quote
  #5  
Old February 27th, 2003, 02:28 PM
richh richh is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Phoenix, AZ
Posts: 11 richh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hey NumberNine,

Yep, perfect sense.. Thanks a million..

Take care,

Rich

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > Need some quick help with returning values.. Please...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT