Skip to content
Snippets Groups Projects
Commit 7454e5bb authored by Tomáš Hozman's avatar Tomáš Hozman
Browse files

input validation

parent f47c4fad
No related branches found
No related tags found
No related merge requests found
......@@ -76,17 +76,19 @@
Vyplň náš jednoduchý formulář, stáhni si ho v PDF a pošli ho datovkou nebo dones osobně na úřad. Neboj se - vážíme si tvého soukromí, nesbíráme žádná osobní data a vše zpracovává výhradně tvůj prohlížeč.
</p>
<div id="form-wrapper">
<form id="form-wrapper">
<div class="input-group input-group-2">
<input
type="text"
id="name"
placeholder="Jméno *"
required
>
<input
type="text"
id="surname"
placeholder="Příjmení *"
required
>
</div>
......@@ -98,6 +100,7 @@
type="date"
id="birth-date"
name="birth-date"
required
>
</div>
......@@ -111,6 +114,7 @@
type="text"
id="street"
placeholder="Ulice, popisné a orientační č. *"
required
>
<div class="input-group input-group-2">
......@@ -118,12 +122,14 @@
type="text"
id="city"
placeholder="Obec *"
required
>
<input
type="text"
id="zip"
placeholder="PSČ *"
required
>
</div>
......@@ -150,14 +156,16 @@
<option>2. kolo</option>
</select>
<button id="create-filled-form">
Podepsat
</button>
<input
type="submit"
id="create-filled-form"
value="Podepsat"
>
<small>
<i>* Povinné</i>
</small>
</div>
</form>
</div>
<div id="step2">
......
......@@ -348,6 +348,12 @@ $(window).ready(
$("#create-filled-form").on(
"click",
async (event) => {
if ($("#form-wrapper")[0].checkValidity()) {
event.preventDefault();
} else {
return;
}
$("#form-wrapper input,#form-wrapper select").attr("disabled", true);
// We already know this, don't waste time looking it up.
// Repeating ourselves once is fine here.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment