[+] Input validation

This commit is contained in:
Azalea
2025-03-11 18:32:00 -04:00
parent c4e0717317
commit eb45075414
2 changed files with 6 additions and 3 deletions

View File

@@ -21,9 +21,9 @@
<!-- First input line -->
<div class="inputs">
<InputTextShort desc="Server Address" placeholder="e.g. http://aquadx.hydev.org"
bind:value={src.server} on:change />
bind:value={src.server} on:change validate={v => /^https?:\/\/[a-z0-9.-]+(:\d+)?$/i.test(v)} />
<InputTextShort desc="Keychip ID" placeholder="e.g. A0299792458"
bind:value={src.keychip} on:change />
bind:value={src.keychip} on:change validate={v => /^[A-Z0-9]{11}$/.test(v)} />
</div>
<!-- Second input line -->