Results 1 to 5 of 5

Thread: HTML-forms: dynamic option list via javascript/ajax?

  1. #1
    Join Date
    Jul 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default HTML-forms: dynamic option list via javascript/ajax?

    there is am form on a site i am working on where visitors can search for holiday houses:

    HTML Code:
    <form id="search" method="get">
    <p>
    <select size="1" name="k">
    <option value="">category</option>
    <option value="3">3*</option>
    <option selected="selected" value="4">4*</option>
    <option value="5">5*</option>
    </select>
    </p>
    <p>
    <select size="1" name="w">
    <option value="">size</option>
    <option value="50">< 50 mē</option>
    <option value="70">50 - 70 mē</option>
    <option value="95">75 - 95 mē</option>
    <option value="1000">more than 95 mē</option>
    </select>
    </p>
    <p id="number_of_persons">
    <select size="1" name="p">
    <option value="">number of persons</option>
    <option value="2">2 persons</option>
    <option value="3">3 persons</option>
    <option value="4">4 persons</option>
    <option value="5">5 persons</option>
    </select>
    </p>
    <p id="search">
    <input class="button" type="submit" value="search"/>
    </p>
    </form>
    i would like to make the form more dynamic for the visitors - if one selects one option in one of the select-boxes the other options of the other select boxes should change dynamically. so that one can only choose from possible options in the other select boxes.

    is there any javascript-/ajax-framework for such a task?

    thanks for your help!


    PS: data is coming from a mySQL-database.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Does this help you at all: http://www.dynamicdrive.com/dynamici...ects/index.htm
    I hope it does,
    Nile
    Jeremy | jfein.net

  3. #3
    Join Date
    Jul 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks for your reply.

    no, unfortunatelly not.

    every order of the selection should be possible:

    select box 1 - select box 2 - select box 3
    select box 2 - select box 3 - select box 1
    select box 3
    select box 3 - select box 2
    select box 3 - select box 2 - select box 1
    etc.

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    You can still easily hook it up with the chained selection script. Unless I do not understand what you want completely... Can you make an image, or give an example?
    Jeremy | jfein.net

  5. #5
    Join Date
    Jul 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    here is an example:

    a visitor is searching for a holiday flat and uses the search form on the website to see the holiday flats which meet his expectations:

    --- example ---
    first he wants a 5* holiday flat (he selects the 5*-option in the "categories-select-box" of the search form)

    he also wants a holiday flat which is larger than 100m2 (so he selects the ">100m2-option" in the "size-select-box" of the search form)

    etc.
    --- /example ---

    how should the form react after selecting the 5*-option? it should only list the options which are avaiable in the other 2 select boxes, etc.

    i hope you can understand my explanation - sorry for my poor english.

    thank you for your help.


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
  •