Show error message in case ant el is (too) negative

This commit is contained in:
phl0
2025-06-17 16:06:03 +02:00
parent 9e23a7b0e8
commit bca4087f69
2 changed files with 11 additions and 1 deletions

View File

@@ -10,6 +10,7 @@
var lang_dxccsummary_for = "<?= __("DXCC Summary for "); ?>";
var lang_lotw_upload_day_ago = "<?= __("LoTW User. Last upload was 1 day ago."); ?>";
var lang_lotw_upload_days_ago = "<?= __("LoTW User. Last upload was %x days ago."); ?>"; // due to the way the string is built (PHP to JS), %x is replaced with the number of days
var lang_invalid_ant_el = "<?= __("Invalid value for antenna elevation:"); ?>";
var latlng=[<?php echo $lat.','.$lng;?>];
</script>
@@ -604,7 +605,7 @@
<div class="mb-3">
<label for="ant_el"><?= __("Antenna Elevation (°)"); ?></label>
<input type="number" inputmode="decimal" step="0.1" min="-5" max="90" class="form-control" id="ant_el" name="ant_el" />
<input type="number" inputmode="decimal" step="0.1" min="-5" max="90" class="form-control" id="ant_el" name="ant_el" onInvalid="invalidAntEl()" />
<small id="elHelp" class="form-text text-muted"><?= __("Antenna elevation in decimal degrees."); ?></small>
</div>
</div>

View File

@@ -97,6 +97,15 @@ function set_timers() {
}, 100);
}
function invalidAntEl() {
var saveQsoButtonText = $("#saveQso").html();
$("#noticer").removeClass("");
$("#noticer").addClass("alert alert-warning");
$("#noticer").html(lang_invalid_ant_el+" "+parseFloat($("#ant_el").val()).toFixed(1));
$("#noticer").show();
$("#saveQso").html(saveQsoButtonText).prop("disabled", false);
}
$("#qso_input").off('submit').on('submit', function (e) {
var _submit = true;
if ((typeof qso_manual !== "undefined") && (qso_manual == "1")) {