SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
-
Jul 6, 2007, 04:47 #1
- 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!
-
Jul 6, 2007, 05:06 #2
- 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.phpVikrant Korde
S Y S T I M E, Mhape,
Mumbai, Maharashtra, India.
-
Jul 6, 2007, 05:11 #3
- 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...
-
Jul 6, 2007, 05:42 #4
- 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.
-
Jul 6, 2007, 06:22 #5
- 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?
-
Jul 6, 2007, 07:35 #6
- 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.
-
Jul 6, 2007, 08:52 #7
- 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