472,354 Members | 1,547 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 software developers and data experts.

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

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 3520
hini
23
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
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
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
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
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
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
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
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
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
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
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
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

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.