-
How to get selected value of select tag in ASP?
Hi friends,
Now i m working in a sample ASP program. In that i want to get the Customer name from the database according to the selected Customer No given in the <select> tag.
For that i want to get the selected value of the <select> tag. I want the coding in VB.script. Can anyone help me?
-
Your select should be something like this, right?
Code:
<select size="1" name="sel1">
<option value="c1">Choice 1</option>
<option value="c2">Choice 2</option>
<option value="c3">Choice 3</option>
<option value="c4">Choice 4</option>
</select>
Notice the word value="c1" in the option tag. This is responsible for sending the "c1" to the browser using the submit button. To get it back in another page, try something like this
Code:
<%response.write request.querystring("sel1")%>
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
 Originally Posted by sundar.doubts
Hi friends,
Now i m working in a sample ASP program. In that i want to get the Customer name from the database according to the selected Customer No given in the <select> tag.
For that i want to get the selected value of the <select> tag. I want the coding in VB.script. Can anyone help me?

heya....u r workin wid database in asp..so ol pages wud b in asp....but il try 2 make it simple 4 u..
1st u make a form in wich write d followin code
<form method="get" action="cust_name.asp">
<select name="sel1">
<option value="o1">cust1</option>
<option value="o2">cust2</option>
.
.
.
.
n so on...okk
</select>
nw make d asp page cust_name.asp write d followin
cust_no=request.querystring("sel1")
open d database...den use dis cust_no to extract d value of cust name...ok
still if u wanna knw hw 2 use select value in vb...heres d code
if f1.sel.selectedindex=0 then
customername="anjali"
elseif f1.sel1.selectedindex=1 then
customername="sid"
end if
in dis f1 is d name of d form....bt u wont b able 2 use a database in dis..
i hope u understud....i wud really lyk 2 knw if im a help 2 u..
mail me at Email address removed....
Last edited by Hack; 01-22-2010 at 07:15 AM.
Reason: Removed EMail Address
-
I have edited your post and removed your email address.
You should never post your email address in an open post on an open forum. Mail spam bots can pick that up and before you know it, your mailbox is full of junk mail. If you wish to share your email address with other forum members, please do so via our PM system.
But even more importantly than that, we prefer all answers to questions be publically posted rather than sent via EMail or PM. That way, everyone with a similar problem can benefit.
Thanks.
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
Similar Threads
-
Replies: 1
Last Post: 02-27-2003, 04:51 AM
-
By Nitin in forum ASP.NET
Replies: 1
Last Post: 04-24-2002, 08:08 PM
-
By Peter in forum ASP.NET
Replies: 0
Last Post: 11-02-2001, 03:42 PM
-
By Victor Tai in forum Web
Replies: 1
Last Post: 07-24-2000, 11:43 AM
-
By Henry White in forum XML
Replies: 0
Last Post: 04-22-2000, 04:08 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks