I use this:
Code:
var valid = "ABCDEFGHIJKLMNOPQRSTUVWZYZabcdefghijklmnopqrstuvwxyz0123456789"
var temp;
var ok = "yes";
for (var i=0; i < document.login.username.value.length; i++) {
temp = "" + document.login.username.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = 'no';
}
if (document.login.username.value.length < 5 || document.login.username.value.length > 15 || ok == 'no'){
alert('not VALID')
document.login.username.select();
return false;}
and it works great
but when I put space ( ) or underline (_) - it seems to return not valid everytime!
what could be the problem?
Thanks