dependent-dropdown-example
dependent-dropdown-example copied to clipboard
If user select None(-------) country, it must not makes ajax requests to server.
- only make ajax request if some country is selected. see pull request:
if (countryId == 0) { //Not selected
$("#id_city").html("<option value=''>---------</option>");
} else
-
disable the city select while the ajax request:
$("#id_city").prop('disabled',true);
-
after ajax request, enable the city select:
$("#id_city").removeAttr("disabled");