Separate javascript from html file
This commit is contained in:
parent
75a581386e
commit
c2194a4c0a
2 changed files with 13 additions and 14 deletions
|
@ -18,18 +18,5 @@
|
|||
<a class="nav-link" href="index.html">Return to main menu</a>
|
||||
</form>
|
||||
</body>
|
||||
<script type = "text/JavaScript">
|
||||
var password = document.getElementById("password");
|
||||
var confirm_password = document.getElementById("confirmPassword");
|
||||
function validatePassword(){
|
||||
if(password.value != confirm_password.value) {
|
||||
confirm_password.setCustomValidity("Passwords Don't Match");
|
||||
}
|
||||
else {
|
||||
confirm_password.setCustomValidity('');
|
||||
}
|
||||
}
|
||||
password.onchange = validatePassword;
|
||||
confirm_password.onkeyup = validatePassword;
|
||||
</script>
|
||||
<script type = "text/JavaScript" src="signupPage.js"></script>
|
||||
</html>
|
12
front/static/signupPage.js
Normal file
12
front/static/signupPage.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
var password = document.getElementById("password");
|
||||
var confirm_password = document.getElementById("confirmPassword");
|
||||
function validatePassword(){
|
||||
if(password.value != confirm_password.value) {
|
||||
confirm_password.setCustomValidity("Passwords Don't Match");
|
||||
}
|
||||
else {
|
||||
confirm_password.setCustomValidity('');
|
||||
}
|
||||
}
|
||||
password.onchange = validatePassword;
|
||||
confirm_password.onkeyup = validatePassword;
|
Loading…
Reference in a new issue