SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Jan 2007
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help with a dropdown come form list

    I have been looking at the following website

    http://www.idexcorp.com/

    I was wondering how they have got their Browse By Business section dropdowns to work by clicking the go button. I can't work out how to do this could someone help me please?

    I currently have the following

    Code:
    <select name="newpage" class="quicksearch" onchange="document.location=this.value">
    <option value="">Customer Service</option>
    <option value="glossary.php">Glossary</option>
    <option value="faq.php">FAQ</option>
    <option value="privacypolicy.php">Privacy Policy</option>
    <option value="termsandconditions.php">Terms &amp; Conditions</option>
    <option value="trademarks.php">Trademarks</option>
    <option value="sitemap.php">Sitemap</option>
    <input type="submit" value="Go" class="submit-button" />
    </select>
    but want it so that a user can selct what they want and then click the submit button

    Cheers

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The code you have must reside inside a <form> and the submission needs to be handled server-side.

    You may additionally choose to use client-side processing by attaching a JavaScript event handler to the submit button. This saves a round-trip to the server for users with JavaScript enabled.

    You'll also need to remove the keyboard-unfriendly onchange handler from your <select> element, since it will redirect the user immediately.

    It's not an HTML question, though, so you should ask in the appropriate server-side forum and/or the JavaScript forum.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Addict
    Join Date
    Jan 2007
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers for that I will try the PHP forum


Bookmarks

Posting Permissions

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