SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Evangelist
    Join Date
    Nov 2005
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Having different select boxes when other things have been selected...

    Hello.

    Say I had a select box in a form that listed clothes... T-Shirts, Trousers, Hats. And I had another select box thats contents depended on what was selected in the first select box... How would I achieve this?

    Say I selected 'T-Shirts' in the first select box... I would then like the second select box to display options for those T-Shirts, such as Small, Medium, Large. Again, if I select 'Hats' in the first select box... I would then like the second select box to display options for those Hats, such as Cotton, Wool.

    How would I achieve this in Javascript?
    Many thanks!

  2. #2
    SitePoint Evangelist vikrantkorde's Avatar
    Join Date
    Jun 2004
    Location
    Mumbai, India
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    THis is possible in Javascript.
    But the problem with this is, it will be very slow. You need to get all the information from the server in first GO.
    The other approach can be AJAX.

    Check this site
    http://www.mymauicondos.com/resdesk/property_search.php
    Vikrant Korde
    S Y S T I M E, Mhape,
    Mumbai, Maharashtra, India.

  3. #3
    SitePoint Evangelist
    Join Date
    Nov 2005
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How would I do such a thing in AJAX? That site is exacly the kind of thing I'm after...

  4. #4
    SitePoint Evangelist vikrantkorde's Avatar
    Join Date
    Jun 2004
    Location
    Mumbai, India
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    right click and get the view source....
    you will get the script toooo
    let me know if u have any doubts in understanding.
    Vikrant Korde
    S Y S T I M E, Mhape,
    Mumbai, Maharashtra, India.

  5. #5
    SitePoint Evangelist
    Join Date
    Nov 2005
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Theres a command in there called 'new Option'... Where's this Option class?

  6. #6
    SitePoint Evangelist vikrantkorde's Avatar
    Join Date
    Jun 2004
    Location
    Mumbai, India
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is the javascript's object
    Vikrant Korde
    S Y S T I M E, Mhape,
    Mumbai, Maharashtra, India.

  7. #7
    SitePoint Evangelist
    Join Date
    Nov 2005
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aaahh.... Got it. Sorted man. Cheers for pointing me to the right area...

    (My script is working a treat!!)


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
  •