Results 1 to 2 of 2

Thread: <select> onChange in dynamic drop down menu

  1. #1
    Join Date
    Aug 2010
    Location
    Vancouver, Canada
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default <select> onChange in dynamic drop down menu

    I am using a html Form to create and populate three dynamic drop down menus. They are Country - State - City. Selecting a country populates the State menu, which in turn populates the City menu once a State is selected. What is missing in this equation is a function to open a new html page of text relating to the selected City. Ergo, a few thousand html pages residing on the server that specifically relate to the cities. From what I can gather, I need some form of <select> onChange coding that will point to the appropriate html page. With some very good help, I have gotten this far, and have my three menus working, leaving me to resolve this final step. Any and all suggestions will be gratefully accepted. This is the Form coding:

    <form>
    <table border="0">
    <tr>
    <td>
    <select id='countrySelect' name='country' onchange='javascript: populateState(); populateCity();'></select>
    </td>
    <td>
    <select id='stateSelect' name='state' onchange='javascript: populateCity();'></select>
    </td>
    <td>
    <select id='citySelect' name='city'></select>
    <script type="text/javascript">initCountry('CA'); </script>
    </td>
    </tr>
    </table>
    </form>

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Do you just want a redirect? You could do:

    onchange="document.location='mydir/'+this.value;"
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics 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
  •