88
rated 0 times
[
95]
[
7]
/ answers: 1 / hits: 17839
/ 10 Years ago, sun, february 16, 2014, 12:00:00
I have a registration page and I want to compare two passwords (input fields) to be equal before writing it to a websql database.
I cannot seem to get it to work.
Any ideas?
function addTodo() {
var todo = document.getElementById(todo);
var todo2 = document.getElementById(todo2);
if(todo != todo2) {
alert(Yours passwords do not match);
} else {
curatio.webdb.addTodo(todo.value);
todo.value = ;
alert(Your Registration was successfull);
setTimeout(function () {
window.location.href = login.html;
}, 1000);
}
}
<div data-role=fieldcontain >
<label for=todo>
Password
</label>
<input name= id=todo placeholder= value= type=password required>
</div>
<div data-role=fieldcontain >
<label for=todo2>
Retype your Password
</label>
<input name= id=todo2 placeholder= value= type=password required>
</div>
More From » javascript