Disable cnty edit field without state filled, reset cnty on reset_fields

This commit is contained in:
Alexey Khromov
2025-05-29 13:03:50 +03:00
parent bee8041cec
commit db5ca5bf69
2 changed files with 14 additions and 3 deletions

View File

@@ -363,7 +363,11 @@ function qso_edit(id) {
case '29':
case '32':
case '281':
$("#stationCntyInputEdit").prop('disabled', false);
if (state != "") {
$("#stationCntyInputEdit").prop('disabled', false);
} else {
$("#stationCntyInputEdit").prop('disabled', true);
}
break;
}
});
@@ -680,12 +684,13 @@ async function updateStateDropdown(dxcc_field, state_label, county_div, county_i
case '32':
case '281':
$(county_div).find('.form-control').show();
$(county_div).find('.form-control').prop('disabled', true);
$(county_div).find('.selectize-control').hide();
$(county_div).show();
break;
default:
$(county_div).hide();
$(county_input).val();
$(county_input).val('');
}
}

View File

@@ -735,6 +735,7 @@ function reset_fields() {
var $select = $('#darc_dok').selectize();
var selectize = $select[0].selectize;
selectize.clear();
$('#stationCntyInputQso').val("");
$select = $('#stationCntyInputQso').selectize();
selectize = $select[0].selectize;
selectize.clear();
@@ -1057,7 +1058,12 @@ $("#callsign").on("focusout", function () {
case '29':
case '32':
case '281':
$("#stationCntyInputQso").prop('disabled', false);
if (result.callsign_state == "") {
$("#stationCntyInputQso").prop('disabled', true);
} else {
$("#stationCntyInputQso").prop('disabled', false);
$("#stationCntyInputQso").val(result.callsign_us_county);
}
break;
default:
$("#stationCntyInputQso").prop('disabled', false);