如何用js限定textbox只能输入大写字母和数字,并且不能超过8个字符 我只知道怎么限制不输入汉字:( 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private void txtOdo_Load(object sender, System.EventArgs e) { ((TextBox)sender).Attributes["onkeyup"] = "value=value.replace(/[^A-Z\\d]/g,'');"; ((TextBox)sender).Attributes["onbeforepaste"] = "clipboardData.setData('text',clipboardData.getData('text').replace(/[^A-Z\\d]/g,''))"; } 楼上的方法已可以解决输入字符的问题,但如何限定必须输入8个字符,解决完马上结贴 asp.net mvc框架下,将网站发布到IIS上,为何图片无法显示 Eval()、XPath() 和 Bind() 这类数据绑定方法只能在数据绑定控件的上下文中使用。 帮找个小错误,立刻给分!!! 请指点:新网页为什么没有显示在IFrame中? Session.RemoveAll()问题 100分,求一用户人控件不显示问题 关闭excel进程,小女子急啊,各位帮忙 我可以不可以在网页上加两段关键和说明? asp.net的ListBox的问题 .aspx文件怎样调用.ascx文件的方法!! 100分求aspxgrid? 水晶报表的“登录失败”问题
{
((TextBox)sender).Attributes["onkeyup"] = "value=value.replace(/[^A-Z\\d]/g,'');";
((TextBox)sender).Attributes["onbeforepaste"] = "clipboardData.setData('text',clipboardData.getData('text').replace(/[^A-Z\\d]/g,''))";
}