文本框如何只输入英文字母数字下划线,越简单越好 <input type="text" onpropertychange="if(/^[\w]*$/g.test(value)==false) value=value.replace(/[^\w]*/g,'')"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title></head><body><label><input type="text" name="textfield" onkeypress="javascript:return check(this);" /></label></body></html><script language="javascript"> function check(obj) { var c = event.keyCode if( c == 13 || (c>=48 && c<=57) || (c>=65 && c<=90) || c==95 || (c>=97 && c<=122) ) return true; return false; }</script> <input type="text" name="textfield" onkeyup="this.value=this.value.replace(/[^\da-z_]/ig,'');"/> 怎么实现button 通过onclick()提交表单? 基础JS问题- - 用js刷新frame 谢谢大家了 高手请进——javascript 自定义对象在HTML页面中引用的问题(很有代表性) 高手请进,,!!!!!急急 光标焦点判定的问题,谢谢! 请问javaScript有没有专门的IDE开发工具之类,就像VS2003这样的有智能提示或者帮助很详细的 难道是IE的BUG?高手请进! 请帮我看下面的代码!! 网页中的拖放功能 有关frame页面的问题 如何使日期增加1个月? 是个页面加载时间等问题,想做一个加载等待页面!求助!
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<label>
<input type="text" name="textfield" onkeypress="javascript:return check(this);" /></label>
</body>
</html>
<script language="javascript">
function check(obj)
{
var c = event.keyCode
if( c == 13 || (c>=48 && c<=57) || (c>=65 && c<=90) || c==95 || (c>=97 && c<=122) )
return true;
return false;
}
</script>