// JavaScript Document function check_alphanumarics(){ var check,char_error = true; var str = document.getElementById('username').value; var pass = document.getElementById('password').value; var email = document.getElementById('email').value; var strreduse = ''; var inchr = ''; var alpha = new Array(' ','!','@','#','$','%','^','&','*','(',')','-','=','_','~','`','{','}','[',']','"',';',':','\'',',','.','/','?','>','<','|'); for(i = 0 ; i < alpha.length; i ++){ if(str.indexOf(alpha[i]) != -1){ check = false; char_error = false; inchr = inchr + " \" "+alpha[i]+ " \"\n"; } } if(str == ''){ check = false; strreduse = strreduse +"Please enter your Username\n"; } if(pass == ''){ check = false; strreduse = strreduse + "Please enter your password\n"; } if(char_error == false){ strreduse = "You can not add following Characters for username \r\n" + inchr + strreduse; } var msg = "Please Correct the followings. \r\n\n"+ strreduse; if(check == false){ alert(msg); return false; } else { return true; } }