Fixes #3056 Stopping invalid callsigns when creating station locations

这个提交包含在:
Peter Goodhall 2024-04-10 17:39:33 +01:00
父节点 04ba3e733b
当前提交 d7c6dbd29f
共有 2 个文件被更改,包括 20 次插入2 次删除

查看文件

@ -36,8 +36,22 @@
<div class="mb-3">
<label for="stationCallsignInput"><?php echo lang("station_location_callsign"); ?></label>
<input type="text" class="form-control" name="station_callsign" id="stationCallsignInput" aria-describedby="stationCallsignInputHelp" placeholder="2M0SQL" required>
<small id="stationCallsignInputHelp" class="form-text text-muted"><?php echo lang("station_location_callsign_hint"); ?></small>
<input type="text" class="form-control" name="station_callsign" id="stationCallsignInput" aria-describedby="stationCallsignInputHelp" placeholder="2M0SQL" pattern="[a-zA-Z0-9\/]*" required oninput="validateInput(this);">
<div id="stationCallsignInputError" style="display: none; color: red;">Only letters, numbers, and forward slashes are allowed.</div>
<script>
function validateInput(input) {
var errorDiv = document.getElementById('stationCallsignInputError');
if (input.checkValidity()) {
input.classList.remove('error-red-border');
errorDiv.style.display = 'none';
} else {
input.classList.add('error-red-border');
errorDiv.style.display = 'block';
}
}
</script>
<small id="stationCallsignInputHelp" class="form-text text-muted"><?php echo lang("station_location_callsign_hint"); ?></small>
</div>
<div class="mb-3">

查看文件

@ -801,4 +801,8 @@ label {
tr.htmx-swapping td {
opacity: 0;
transition: opacity 1s ease-out;
}
.error-red-border {
border-color: red;
}