Answer the question
In order to leave comments, you need to log in
Select update?
There are 2 selects (country and city).
They work on the principle: a country is selected and filtered out by an sql query of the city for this country.
Because almost did not work with javascript, I want to ask how to implement through onchange, update select'a with cities.
Answer the question
In order to leave comments, you need to log in
Google the following topics:
• AJAX
• JSON
• appendChild
If jQuery is available, google:
• jQuery ajax
• jQuery append
HTMLSelectElement (http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-94282980 ) has add()/remove() methods to clear the list of options and add options, while appendChild , if my memory serves me? works crookedly in different browsers.
Another option is to stupidly replace the select with a new select by replacing innerHTML on the wrapper - most likely it will work faster.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question