473,503 Members | 1,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do you retrieve data when selecting a value from a drop down list?

1 New Member
I have designed a web form, which has a drop down list. What i would like to do is when a user selects a value from the drop down list and submits the form, the user is redirected to the next page, which provides them with further infomation on the selection they have made. I am using asp and an access database. If any one can help it will be greatly appreciated.
Thank you
Mar 25 '07 #1
3 3575
hini
23 New Member
this is a simple code that you can test, name the file "thepage.asp"

Expand|Select|Wrap|Line Numbers
  1.  
  2. <%
  3. text1 = request("mySelect")
  4. if text1 <> "" then response.write("you selected " & text1)
  5. %>
  6.  
  7. <form method="post" action="thepage.asp">
  8. <select name="mySelect">
  9. <option>first</option>
  10. <option>second</option>
  11. </select>
  12. <input type="submit" value=" Submit Your Choice ">
  13. </form>
  14.  
you may put the first lines in another file, in this case you need to change the "action" attribute of the form to the new asp page.

and you can put a query in the new page that selects additional information about the selected entry.
Mar 26 '07 #2
padmakar
14 New Member
you can catch values via javascript from a select value and transfer the selected value to another page using querystring
var myselect=document.getelementbyid("select")

get the value selected by:
myselect[myselect.options.selectedIndex].value

pass this value in querystring
Mar 26 '07 #3
Dipti Singh
20 New Member
on the second page u can simply get the value what the user selected.

val=request.form("xxxx")

in the page page your select statements will be like this:

<select name="xxxx">
<option name="firstoption" value="1">some text</option>
<option name="secondoption" value="2">other text</option>
</select>

the above request.form.... will give the selected value to val variable.
eg: 1 or 2

now this value can be checked in SQL query.


I have designed a web form, which has a drop down list. What i would like to do is when a user selects a value from the drop down list and submits the form, the user is redirected to the next page, which provides them with further infomation on the selection they have made. I am using asp and an access database. If any one can help it will be greatly appreciated.
Thank you
Mar 26 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
9989
by: Rod Early | last post by:
I need to know when the select element's dropdown list is opened (as when the user clicks on the arrow or does ALT-downarrow from the keyboard). Similarly, I need to known when the dropdown list...
5
6518
by: SirPoonga | last post by:
I think I'd have to do a combination of ASP and javascript to do this. What I want to do fill the first drop down box with values from a database query. Then based off that selection fill in the...
2
1574
by: Chris Windsor | last post by:
I hope the following describe what I'm trying to do: I have created a tool to be used by product analysts when studying different cell phone designs. Part of the tool is a set of 11 forms on a...
13
5209
by: Leszek Taratuta | last post by:
Hello, I have several drop-down lists on my ASP.NET page. I need to keep data sources of these lists in Session State. What would be the most effective method to serialize this kind of data...
5
4204
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1);...
13
2069
by: MikeS | last post by:
I am relatively new to VB.Net so bear with me. I can add an OleDBDataAdapter using the Jet 4.0 with no problem (although I'm having problems getting Date and Time formats to carry over to the...
6
3123
by: Mike Wilson | last post by:
Dear Group, I have a heirarchical set of database tables, say - "order" and "order_type" and want to display a series of orders in a grid control, and in place of the order_type foreign key...
9
1722
by: rickou812 | last post by:
What I am attempting to do is create a form field in which a company name can be selecting from a drop down box. When selecting I want to display the information from my database about the selected...
2
3311
Chittaranjan
by: Chittaranjan | last post by:
Hi All, I have a problem and hope I can get the better solution from here. I have a form written in HTML and I need to write that in perl so the main problem I am facing is that I need to...
0
7074
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6982
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7451
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4667
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3161
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1501
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.