js snippet of dxcc warning in footer

This commit is contained in:
HB9HIL
2023-10-14 21:05:33 +02:00
parent 262c0ea888
commit 4b0f32fd6a
3 changed files with 25 additions and 38 deletions

View File

@@ -45,7 +45,11 @@
<input type="number" class="form-control" name="station_power" id="stationPowerInput" step="1" aria-describedby="stationPowerInputHelp" placeholder="10">
<small id="stationPowerInputHelp" class="form-text text-muted"><?php echo lang("station_location_power_hint"); ?></small>
</div>
<!-- Loading Warning Text for Deleted DXCC -->
<script>
var lang_station_location_dxcc_warning = '<?php echo lang('station_location_dxcc_warning'); ?>';
var isDeleted = selectedOption.textContent.includes("<?php echo lang('gen_hamradio_deleted_dxcc'); ?>");
</script>
<div class="form-group">
<label for="stationDXCCInput"><?php echo lang("station_location_dxcc"); ?></label>
<?php if ($dxcc_list->num_rows() > 0) { ?>
@@ -60,24 +64,6 @@
<small id="stationDXCCInputHelp" class="form-text text-muted"><?php echo lang("station_location_dxcc_hint"); ?></small>
<div id="warningMessage" style="color: red;"></div>
</div>
<!-- DXCC Deleted Warning -->
<script>
var lang_station_location_dxcc_warning = '<?php echo lang('station_location_dxcc_warning'); ?>';
</script>
<script>
document.getElementById('dxcc_select').addEventListener('change', function() {
var selectedOption = this.options[this.selectedIndex];
var isDeleted = selectedOption.textContent.includes('<?php echo lang('gen_hamradio_deleted_dxcc'); ?>');
if (isDeleted) {
this.style.border = '2px solid red';
warningMessage.innerText = lang_station_location_dxcc_warning;
} else {
this.style.border = '';
warningMessage.innerText = "";
}
});
</script>
<div class="form-group">
<label for="stationCityInput"><?php echo lang("station_location_city"); ?></label>