function alpha_num_check(obj) {
str = obj.value;
len = str.length;
ch = str.charAt(0);
for(i = 0; i < len; i++) {
ch = str.charAt(i);
if( (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') ) {
continue;
} else {
alert("영문과 숫자만 입력이 가능합니다.");
obj.value="";
obj.focus();
return false;
}
}
return true;
}
</script>
<input type="text" name="keypassword" maxlength="20" style="width:100px" onkeyup="alpha_num_check(this);">