kopia lustrzana https://github.com/magicbug/Cloudlog
Fixes #3056 Stopping invalid callsigns when creating station locations
rodzic
04ba3e733b
commit
d7c6dbd29f
|
@ -36,7 +36,21 @@
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="stationCallsignInput"><?php echo lang("station_location_callsign"); ?></label>
|
<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>
|
<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>
|
<small id="stationCallsignInputHelp" class="form-text text-muted"><?php echo lang("station_location_callsign_hint"); ?></small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -802,3 +802,7 @@ tr.htmx-swapping td {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: opacity 1s ease-out;
|
transition: opacity 1s ease-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.error-red-border {
|
||||||
|
border-color: red;
|
||||||
|
}
|
Ładowanie…
Reference in New Issue