When I run this code it doesn't seem to be doing what I expect. So this is a validation, and when I run the if statement, the validator stops running when it hits the false. But when it hits the false from the other function numCheck, it alerts but then just continues. Since there are more validations below, if the numCheck comes back clean, how do I continue through the rest of the validation rather than cutting out if it's true? Where am I going wrong?
function numCheck(num){
if(isNaN(num)){
alert("Vendor number must be numeric");
focusTo(document.forms["parts"]["vendorNo"]);
return false;
}
}
function validateForm(){
//DECLARATION
var vendorNo = document.forms["parts"]["vendorNo"].value;
//VENDOR NUMBER
numCheck(vendorNo);
if(vendorNo.length != 4){
alert("Please enter 4 digit Vendor Number");
focusTo(document.forms["parts"]["vendorNo"]);
return false;
}
Thank you in advance, I've spent a lot of time trying to figure this out.