Click to See Complete Forum and Search --> : Access HTML dropdown from ASP


Dankoni
July 29th, 2008, 02:17 PM
Is there a way to access the value of an HTML dropdown box from within Classic ASP?

Example:

<select name="Location" id="Location">
<option selected="selected">Select Location</option>
<option value="Mechanicsburg">Mechanicsburg</option>
<option value="Carlisle">Carlisle</option>
<option value="Enola">Enola</option>
<option value="Harrisburg">Harrisburg</option>
</select>

Now, is there a way to access what the user selects from within ASP? I want to change where a form is sending based on which option the user selects.

Thanks all.

PeejAvery
July 30th, 2008, 09:24 AM
Remember that ASP is a server-side language. The only access it has to the client-side information is what is passed to it. In this case, ASP can grab the value selected for Location only if it is passed. In this case, you could use...

dim theLocation
theLocation = Request.Form("Location")