I'm a newbie scripter and these are my first javascript attempts. What this code is supposed to do is: It's a calculator but first it requires registration. (It's kinda fiction though, as you can just press Continue without registering). What I wanted to do is: if the password I entered is less than 5 characters then it should say a message that an error occured and nothing to happen after that. If the password is more tahn 5 characters then it should continue on with the calculator.
So here is the code but no matter how many characters my password has it simply launches the calculator directly going to the else statement.
var pw = document.getElementByID("userInput2").value;
function triggerCalc(){
if (pw<5){
alert("An error occured. Your password must be more than 5 symbols!");
}
else { ... }
}