prvni várka

This commit is contained in:
2024-04-17 23:13:56 +02:00
commit 25ef045289
19 changed files with 433 additions and 0 deletions

20
Formulář/index.html Normal file
View File

@ -0,0 +1,20 @@
<!-- Registrační formulář -->
<div class="container">
<h2>Registrace</h2>
<form id="registrationForm" onsubmit="return validateForm()">
<div class="form-group">
<label for="username">Jméno:</label>
<input type="text" id="username" name="username" required />
</div>
<div class="form-group">
<label for="password1">Heslo:</label>
<input type="password" id="password1" name="password1" required />
</div>
<div class="form-group">
<label for="password2">Potvrďte heslo:</label>
<input type="password" id="password2" name="password2" required />
<span id="passwordMatch"></span>
</div>
<button class="log" type="submit">Registrovat</button>
</form>
</div>

14
Formulář/script.js Normal file
View File

@ -0,0 +1,14 @@
// Formulář
function validateForm() {
var password1 = document.getElementById("password1").value;
var password2 = document.getElementById("password2").value;
var passwordMatch = document.getElementById("passwordMatch");
if (password1 !== password2) {
passwordMatch.textContent = "Hesla se neshodují";
passwordMatch.style.color = "red";
return false;
} else {
return true;
}
}

34
Formulář/style.css Normal file
View File

@ -0,0 +1,34 @@
/*Formulář*/
.container {
max-width: 400px;
margin: 0 auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
}
.form-group {
margin-bottom: 20px;
}
label {
display: block;
font-weight: bold;
}
input {
width: 100%;
padding: 8px;
font-size: 16px;
}
button {
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}