I\'m trying to write a php script that will populate a second drop down menu based on the selection of the a primary drop down menu. I would like to use jquery to do all the
Add one more line jQuery('#city').html('');
Now the code look like :
jQuery(document).ready(function() {
jQuery('#state').change(function() {
jQuery('#city').html('');
jQuery.post(
'some-url.php',
{
'state':jQuery('#state').val()
},
function(data, textStatus) {
jQuery.each(data, function(index, value) {
jQuery('#city').append('');
});
},
'json'
);
});
});