Again when user select the state they need to be presented with cities dropdowns. Now, when the user select USA then states dropdown needs to be populated by using jQuery. First populate the country dropdown (eg: usa, uk etc.,). I am trying to accomplish dropdowns using JSON. Here are some more FAQ related to this topic: The PHP code inside 'process-request.php' will look something like this: Related FAQ The 'process-request.php' file on the server then process the request, if the request succeeds the jQuery script receives the returned data and creates the city dropdown list. The jQuery script above send the value of option selected in the country dropdown to the server. You can do this easily through the jQuery ajax() method and with the little help of any server side scripting language like PHP. Populating the state or city dropdown based on the value of option selected by the user in country dropdown is a very common implementation of ajax feature that you have seen on many websites while filling the registration form. Topic: JavaScript / jQuery Prev|Next Answer: Use the jQuery ajax() method
0 Comments
Leave a Reply. |