Welcome Guest, Not a member yet? Register   Sign In
Combined select with dropdown lists into the form
#5

[eluser]Scal[/eluser]
Something alike
$('state drop down selector').change(function(){
$('ciites drop down selector').html = ''; // reset the options for the cities
$('ciites drop down selector').html = $.get('/controller/getCitiesFromState/' + $(this).text); // set the options for the cities
}
)

Whenever the option is changed from the States drop down menu, the select drop down menu for cities is cleaned and you assign the request value to it.
Your controller with the 'getCitiesFromState' method should return the <option> elements only as it will be 'injected' into the <select> element.
There are many ways to do this, experiment and find the best solution for your needs, also this is a rough example to get you started; it is not meant as the final script solution for your need.

Good luck Smile


Messages In This Thread
Combined select with dropdown lists into the form - by El Forum - 10-13-2009, 02:56 AM
Combined select with dropdown lists into the form - by El Forum - 10-13-2009, 03:37 AM
Combined select with dropdown lists into the form - by El Forum - 10-13-2009, 04:30 AM
Combined select with dropdown lists into the form - by El Forum - 10-13-2009, 07:20 AM
Combined select with dropdown lists into the form - by El Forum - 10-13-2009, 08:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB