I am using this function to check that a string contains at least one letter and number but for some reason it doesnt work. Is the regex string invalid? I only want to allow letters and numbers. and the password must contain at least one letter and number.
so this would fail val = "1234567"
this would fail val = "abcdefg"
this would pass val = "234ftgh"
this would pass val = "abcgf2"
var val = document.getElementById("pass").value;
alert("Password has to have at least one number and one letter character.");