code formatting, checking for mismatched passwords
This commit is contained in:
@@ -10,13 +10,14 @@ function showPasswd() {
|
||||
}
|
||||
}
|
||||
|
||||
const password = document.getElementById("Password").trim();
|
||||
const sPassword = document.getElementById("sPassword").trim();
|
||||
document.getElementById('signupForm').addEventListener('submit',async function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
document.getElementById('signupForm').addEventListener('submit',function (event) {
|
||||
const password = document.getElementById("password").value;
|
||||
const sPassword = document.getElementById("sPassword").value;
|
||||
console.log(password, sPassword);
|
||||
|
||||
if(password !== sPassword){
|
||||
alert("Passwords don't match!");
|
||||
event.preventDefault();
|
||||
}
|
||||
})
|
||||
|
||||
@@ -14,16 +14,13 @@
|
||||
<h1>Login</h1>
|
||||
<form action="/auth/signup" method="post" id="signupForm">
|
||||
|
||||
<label for="username">
|
||||
</label>
|
||||
<label for="username"></label>
|
||||
<input type="text" name="username" placeholder="Username" id="username" required>
|
||||
|
||||
<label for="password">
|
||||
</label>
|
||||
<label for="password"></label>
|
||||
<input type="password" name="password" placeholder="Password" id="password" required>
|
||||
|
||||
<label for="sPassword">
|
||||
</label>
|
||||
<label for="sPassword"></label>
|
||||
<input type="password" name="sPassword" placeholder="Confirm password" id="sPassword" required>
|
||||
|
||||
<input type="checkbox" onclick="showPasswd()">Show Passwords
|
||||
|
||||
Reference in New Issue
Block a user