Hi, I am looking for jquery script which would list of states on site in vertical and when ever you click on state it will show list of cities. Script similar to http://www.kijiji.ca they using it to select location. Thank You Please help to find one
1- create 3 divs (or a table if you prefer) 2- list the states using php (or ajax if you'ld like) in the first element and add an onclick event to the items 3- when onclick event is triggered do an ajax call to collect the data and populate div 2 and add an event on those as well edit : ok they do it differently ... you could as well load everything in 1 array and get the data based on array keys...
Why... Make it a FORM - that way it will also work if the javascript is NOT present. Put all the states in a dropdown (select-input), and depending on which one is chosen, you show only the relevant cities (make an onchange-event) - you can even do a selection of available / non-available cities in the second drop-down, with optgroups disabled/not disabled - that way the whole list will be there, but it won't be possible to select anything not related - you can also "jump" to the proper optgroup based on what selection you chose from the first select.