I can't seem to figure out what's wrong with the code. The first prompt is working right but the second one only reads it as the error message.
- Code:
var register = prompt("You are not registered, please type a password to register:");
function succsess() {
document.write("Succsess! You are now in the registered users page");
}
function failed() {
document.write("Wrong Password! Try again");
}
if (register = "") {
alert("ERROR: You have to type something as a password");
} else {
var user = prompt("You have registered with a valid password");
}
if (register == user) {
succsess();
} else {
failed();
}
Last edited by Shadow@BWH on 3/12/2015, 7:48 am; edited 1 time in total