diff --git a/hr/templates/hr/person_form.html b/hr/templates/hr/person_form.html index dabced4..3def2bb 100644 --- a/hr/templates/hr/person_form.html +++ b/hr/templates/hr/person_form.html @@ -18,17 +18,21 @@

Person Form

$("#id_country").change(function () { var url = $("#personForm").attr("data-cities-url"); var countryId = $(this).val(); - - $.ajax({ - url: url, - data: { - 'country': countryId - }, - success: function (data) { - $("#id_city").html(data); - } - }); - + + if (countryId == 0) { //Not selected + $("#id_city").html(""); + } + else { + $.ajax({ + url: url, + data: { + 'country': countryId + }, + success: function (data) { + $("#id_city").html(data); + } + }); + } });