From 17713e08e518fea6779f5db3baadba84a775ff2d Mon Sep 17 00:00:00 2001 From: kc9uhi Date: Tue, 20 Jan 2026 05:08:28 -0700 Subject: [PATCH] Fix US County entry --- application/views/station_profile/create.php | 2 +- assets/js/sections/station_locations.js | 87 ++++++++++---------- 2 files changed, 44 insertions(+), 45 deletions(-) diff --git a/application/views/station_profile/create.php b/application/views/station_profile/create.php index 4c7fc7e16..0bdb3e1fe 100644 --- a/application/views/station_profile/create.php +++ b/application/views/station_profile/create.php @@ -110,7 +110,7 @@ if ($dxcc_list->result() > 0) {
- +
diff --git a/assets/js/sections/station_locations.js b/assets/js/sections/station_locations.js index 042a69f8b..5c568ff19 100644 --- a/assets/js/sections/station_locations.js +++ b/assets/js/sections/station_locations.js @@ -10,7 +10,7 @@ $(document).ready(function () { } $('.btn-pwd-showhide').off('click').on('click', btn_pwd_showhide ); - $("#station_locations_table").DataTable({ + $('#station_locations_table').DataTable({ stateSave: true, language: { url: getDataTablesLanguageUrl(), @@ -36,16 +36,15 @@ $(document).ready(function () { 'position': 'sticky', 'top': '0px', 'z-index': 1, 'background-color':'inherit', 'width':'100%', 'height':'37px' }) - if (window.location.pathname.indexOf("/station/edit") !== -1 || window.location.pathname.indexOf("/station/create") !== -1 || window.location.pathname.indexOf("/station/copy") !== -1) { - + if (window.location.pathname.indexOf('/station/edit') !== -1 || window.location.pathname.indexOf('/station/create') !== -1 || window.location.pathname.indexOf('/station/copy') !== -1) { updateStateDropdown('#dxcc_id', '#stateInputLabel', '#location_us_county', '#stationCntyInputEdit'); - $('#location_us_county_edit').show(); + $('#location_us_county').show(); var dxcc = $('#dxcc_id').val(); switch (dxcc) { case '6': case '110': case '291': - $("#stationCntyInputEdit").prop('disabled', false); + $('#stationCntyInputEdit').prop('disabled', false); selectize_usa_county('#stateDropdown', '#stationCntyInputEdit'); break; case '15': @@ -60,12 +59,13 @@ $(document).ready(function () { case '29': case '32': case '281': - $("#stationCntyInputEdit").prop('disabled', false); - break; + $('#stationCntyInputEdit').prop('disabled', false); + break; default: - $("#stationCntyInputEdit").prop('disabled', true); - } - $("#dxcc_id").change(function () { + $('#stationCntyInputEdit').prop('disabled', true); + } + + $('#dxcc_id').change(function () { updateStateDropdown('#dxcc_id', '#stateInputLabel', '#location_us_county', '#stationCntyInputEdit'); }); @@ -102,40 +102,39 @@ $(document).ready(function () { }, }); }); - } }); -$("#stateDropdown").change(function () { - var dxcc = $('#dxcc_id').val(); - var state = $("#stateDropdown.form-select").val(); - if (state != '') { - switch (dxcc) { - case '6': - case '110': - case '291': - $("#stationCntyInputEdit").prop('disabled', false); - break; - case '15': - case '54': - case '61': - case '126': - case '151': - case '288': - case '339': - case '170': - case '21': - case '29': - case '32': - case '281': - $("#stationCntyInputEdit").prop('disabled', false); - break; - default: - $("#stationCntyInputEdit").prop('disabled', true); - } - } else { - $("#stationCntyInputEdit").val(''); - $("#stationCntyInputEdit").prop('disabled', true); - } - }); - +$('#stateDropdown').change(function () { + var dxcc = $('#dxcc_id').val(); + var state = $('#stateDropdown.form-select').val(); + if (state != '') { + switch (dxcc) { + case '6': + case '110': + case '291': + $('#stationCntyInputEdit').prop('disabled', false); + selectize_usa_county('#stateDropdown', '#stationCntyInputEdit'); + break; + case '15': + case '54': + case '61': + case '126': + case '151': + case '288': + case '339': + case '170': + case '21': + case '29': + case '32': + case '281': + $('#stationCntyInputEdit').prop('disabled', false); + break; + default: + $('#stationCntyInputEdit').prop('disabled', true); + } + } else { + $('#stationCntyInputEdit').val(''); + $('#stationCntyInputEdit').prop('disabled', true); + } +}); \ No newline at end of file