Jump to content

Drop down box


Guest agentclo

Recommended Posts

Guest agentclo

Hey,I've searched for awhile trying to figure out how to get this to work. The problem that i'm having is that with the drop down box you can select a state. Then when you go to the other page it dosen't come up. I had it befor where you selected the state you were from and then you go to submit and on the next page it said it. The only thing is it only did it with the first 5. Then after the 5th one it would show just the number. So i played around with it and now it dosen't show anything. So where could I find the information or what could I do to fix it?

This is the java code im using<html><head><script type="text/javascript">function getOption(){var x=document.getElementById("Select")alert(x.options[x.selectedIndex].text)}</script></head><body>Here is the html for the drop down box.<select id="Select"><option selected>Choose State<option>Alabama </option><option>Alaska </option><option>Arizona </option><option>Arkansas </option><option>California </option><option>Colorado </option><option>Connecticut </option><option>D.C. </option><option>Delaware </option><option>Florida </option><option>Georgia </option><option>Hawaii </option><option>Idaho </option> <option>Illinois </option><option>Indiana </option><option>Iowa </option><option>Kansas </option><option>Kentucky </option><option>Louisiana </option><option>Maine </option><option>Maryland </option><option>Massachusetts </option><option>Michigan </option><option>Minnesota </option><option>Mississippi </option><option>Missouri </option><option>Montana </option><option>Nebraska </option><option>Nevada </option><option>New Hampshire </option><option>New Jersey </option><option>New Mexico </option><option>New York </option><option>North Carolina </option><option>North Dakota </option><option>Ohio </option><option>Oklahoma </option><option>Oregon </option><option>Pennsylvania </option><option>Puerto Rico </option><option>Rhode Island </option><option>South Carolina </option><option>South Dakota </option><option>Tennessee </option><option>Texas </option><option>Utah </option><option>Vermont </option><option>Virginia </option><option>Washington </option><option>West Virgina </option><option>Wisconsin </option><option>Wyoming </option></select>Then here is the asp on the other page, im pretty sure this is right but im putting it up just incase it may help any. <body><%Response.Write("First Name = " & Request.Form("firstname"))Response.Write("<br>")Response.Write("Last Name = " & Request.Form("lastname"))Response.Write("<br>")Response.Write("Address = " & Request.Form("address"))Response.Write("<br>")Response.Write("City = " & Request.form("city"))Response.Write("<br>")Response.Write("State = " & Request.Form("Select"))Response.Write("<br>")Response.Write("Zip Code = " & Request.Form("zip"))%></body>

Link to comment
Share on other sites

Hey,I've searched for awhile trying to figure out how to get this to work. The problem that i'm having is that with the drop down box you can select a state. Then when you go to the other page it dosen't come up. I had it befor where you selected the state you were from and then you go to submit and on the next page it said it. The only thing is it only did it with the first 5. Then after the 5th one it would show just the number. So i played around with it and now it dosen't show anything. So where could I find the information or what could I do to fix it?
This is the java code im using<html><head><script type="text/javascript">function getOption(){var x=document.getElementById("Select")alert(x.options[x.selectedIndex].text)}</script></head><body>Here is the html for the drop down box.<select id="Select"><option selected>Choose State<option>Alabama </option><option>Alaska </option><option>Arizona </option><option>Arkansas </option><option>California </option><option>Colorado </option><option>Connecticut </option><option>D.C. </option><option>Delaware </option><option>Florida </option><option>Georgia </option><option>Hawaii </option><option>Idaho </option> <option>Illinois </option><option>Indiana </option><option>Iowa </option><option>Kansas </option><option>Kentucky </option><option>Louisiana </option><option>Maine </option><option>Maryland </option><option>Massachusetts </option><option>Michigan </option><option>Minnesota </option><option>Mississippi </option><option>Missouri </option><option>Montana </option><option>Nebraska </option><option>Nevada </option><option>New Hampshire </option><option>New Jersey </option><option>New Mexico </option><option>New York </option><option>North Carolina </option><option>North Dakota </option><option>Ohio </option><option>Oklahoma </option><option>Oregon </option><option>Pennsylvania </option><option>Puerto Rico </option><option>Rhode Island </option><option>South Carolina </option><option>South Dakota </option><option>Tennessee </option><option>Texas </option><option>Utah </option><option>Vermont </option><option>Virginia </option><option>Washington </option><option>West Virgina </option><option>Wisconsin </option><option>Wyoming </option></select>Then here is the asp on the other page, im pretty sure this is right but im putting it up just incase it may help any. <body><%Response.Write("First Name = " & Request.Form("firstname"))Response.Write("<br>")Response.Write("Last Name = " & Request.Form("lastname"))Response.Write("<br>")Response.Write("Address = " & Request.Form("address"))Response.Write("<br>")Response.Write("City = " & Request.form("city"))Response.Write("<br>")Response.Write("State = " & Request.Form("Select"))Response.Write("<br>")Response.Write("Zip Code = " & Request.Form("zip"))%></body>

Just try the following in the first pageReplace <select id="Select"> By <select id="Select" Name="Select">This may solve the problem
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...