Basicly i have this function:
function testLength(){
var input1 = document.getElementById("input1").value
var input2 = document.getElementById("input2").value
alert("test")
if (input1.length < 2 && input2.lenght < 2){
alert("Please enter more then one symbol");
return false
}
}
and a intputs:
<input type="text" name="input1" id="input1">
<input type="text" name="input2" id="input1">
<input type="submit" onclick="testLength();" value="press me">
the idea is if the inputs are 1 character long, not allow the submission but although even if my inputs are 1 character long, it doesn't appear to go into the if statment which (I assume) should stop submit button from submitting. Any idea as to why?