CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2008
    Posts
    2

    Access HTML dropdown from ASP

    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.

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Access HTML dropdown from ASP

    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...

    Code:
    dim theLocation
    theLocation = Request.Form("Location")
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured