I have 3 drop-down lists: countries, states and cities.
States and cities are dependent on the previous form and are downloaded via AJAX.
In Firefox and Chrome, everything is fine, but in IE (8 in my case), when I select the state, the cities pop-up menu does not load. This is similar to the fact that IE does not detect changes. This is not a download problem because I tested it with a simple notification window.
Any help would be really appreciated.
The loaded status page is similar to:
<select id="woeid_state"> <option value="1">Alabama</option> <option value="2">Florida</option> </select>
The loaded cities page is similar to:
<select id="woeid_town"> <option value="100">Miami</option> <option value="101">Orlando</option> </select>
Js
$(document).ready(function() { function loadStates( parent_woeid ) { $('#states').load("<?php echo $states_page?>"+parent_woeid); return false; } function loadCities( parent_woeid ) { $('#towns').load("<?php echo $cities_page;?>/admin1/"+parent_woeid); return false; } $("#woeid_country").change(function() {
The form:
<form class="ordinary_form" method="post" action=""> <label>Country</label> <select name="woeid_country" id="woeid_country"> <option value="23424975">United Kingdom</option> <option value="23424977">United States</option> <option value="23424979">Uruguay</option> <option value="23424980">Uzbekistan</option> <option value="23424907">Vanuatu</option> <option value="23424982">Venezuela</option> <option value="23424984">Vietnam</option> </select> <label>State/Province</label> <div id="states"></div> <label>City</label> <div id="towns"></div> </form>
UPDATE: usign jQuery 1.3
SOLUTION: brought by Daniel: replace .change with .click
source share