怎样判断文本域输入的是字符? <input type=text name=txt><input type=button value=check onclick=if(/\W/.test(txt.value))alert("非法字符")> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 for( var i=0;i<document.form.a.value.length;i++ ){ var ch = document.form.a.value.charAt(i); if(!((ch>='0'&&ch<='9')||(ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z'))){ alert("必须为字符!"); document.orm.a.focus(); return false; } }虽然麻烦了一点儿,还是挺好用的 我一般都是用wuque007(阿华)的这种方法,呵呵 svg 动画 http怎么请求到axis webservice 中的方法 ext和jQuery的问题 200分Help!Help!Help! struts导出excel问题,请教各位,先谢谢了!!!!!!!!! JSP实现验证码 奇怪的文件名问题 如何在JSP当中设置SESSION时间的长度. JDBC连接数据库的问题 如何打包?请教中。。。 请问怎样显示数值型数据? jsp中forward
var ch = document.form.a.value.charAt(i);
if(!((ch>='0'&&ch<='9')||(ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z'))){
alert("必须为字符!");
document.orm.a.focus();
return false; }
}
虽然麻烦了一点儿,还是挺好用的