⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jsp中如何是文本框中只能输入英文,并限制其长度 java - web 开发 - csdn社区 community_csdn_net.htm

📁 jsp中如何是文本框中只能输入英文,并限制其长度
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function &nbsp; check(){ 
&nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var 
&nbsp; str=document.form1.kk.value; &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var &nbsp; re=/^[a-zA-Z_]{1,}$/; &nbsp; 
<BR>&nbsp; if(!str.match(re)){ &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; 
alert("&amp;cedil;&amp;ntilde;&amp;Ecirc;&amp;frac12;&amp;sup2;&amp;raquo;&amp;Otilde;&amp;yacute;&amp;Egrave;·&amp;pound;&amp;iexcl;"); 
&nbsp; <BR>&nbsp; }else{ &nbsp; <BR>&nbsp; alert("OK"); &nbsp; <BR>&nbsp; } 
&nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 
&nbsp; &nbsp; <BR>&nbsp; } &nbsp; <BR>&nbsp; &lt;/script&gt; &nbsp; &nbsp; 
<BR>&nbsp; &lt;input &nbsp; type=submit &nbsp; name=ok &nbsp; value="OK" &nbsp; 
onclick="check()"&gt; &nbsp; <BR>&nbsp; &lt;/form&gt; &nbsp; <BR>&nbsp; &nbsp; 
<BR>&nbsp; &lt;/BODY&gt; &nbsp; <BR>&nbsp; &lt;/HTML&gt; &nbsp; <BR>&nbsp; <A 
href="http://topic.csdn.net/t/20040727/09/3213235.html#">Top</A></P>
<H3><STRONG><A class=anchor name=r_22670404>7 楼</A>POwner(哦勒,哦勒,哦)<INPUT class=user4 title="四级用户 该版得分小于等于2000分,大于1000分" type=button></STRONG><SPAN>回复于 
2004-07-27 09:38:57 得分 0 </SPAN></H3>
<P>是的刚才我只验证的是一个字符<A 
href="http://topic.csdn.net/t/20040727/09/3213235.html#">Top</A></P>
<H3><STRONG><A class=anchor name=r_22670471>8 楼</A>POwner(哦勒,哦勒,哦)<INPUT class=user4 title="四级用户 该版得分小于等于2000分,大于1000分" type=button></STRONG><SPAN>回复于 
2004-07-27 09:40:25 得分 0 </SPAN></H3>
<P>长度好办,if(document.form1.kk.length&lt;10)alert("ggggggggg");就可以了<A 
href="http://topic.csdn.net/t/20040727/09/3213235.html#">Top</A></P>
<H3><STRONG><A class=anchor name=r_22672647>9 楼</A>yulincao(csdnlover)<INPUT class=user1 title="一级用户 该版得分小于等于100分" type=button></STRONG><SPAN>回复于 
2004-07-27 10:41:34 得分 0 </SPAN></H3>
<P>to &nbsp; POwner(哦勒,哦勒,哦) &nbsp; 
你的代码是在文本框中只能输入非英文后,再检验,请问如何是文本框中只能输入英文,而不能输入非英文<A 
href="http://topic.csdn.net/t/20040727/09/3213235.html#">Top</A></P>
<H3><STRONG><A class=anchor name=r_22675212>10 楼</A>pengpong(网上飘)<INPUT class=user2 title="二级用户 该版得分小于等于500分,大于100分" type=button></STRONG><SPAN>回复于 
2004-07-27 11:40:28 得分 <EM>1</EM></SPAN></H3>
<P>up<A href="http://topic.csdn.net/t/20040727/09/3213235.html#">Top</A></P>
<H3><STRONG><A class=anchor name=r_22675347>11 楼</A>chenhui9876(慧子)<INPUT class=user2 title="二级用户 该版得分小于等于500分,大于100分" type=button></STRONG><SPAN>回复于 
2004-07-27 11:43:41 得分 <EM>1</EM></SPAN></H3>
<P>收藏<A href="http://topic.csdn.net/t/20040727/09/3213235.html#">Top</A></P>
<H3><STRONG><A class=anchor name=r_22676043>12 楼</A>spiritsl(梦雨心蓝)<INPUT class=user4 title="四级用户 该版得分小于等于2000分,大于1000分" type=button></STRONG><SPAN>回复于 
2004-07-27 12:01:11 得分 <EM>8</EM></SPAN></H3>
<P>方法如POwner(哦勒,哦勒,哦) &nbsp; <BR>&nbsp; 调用时把onclick事件改为onKeyPress<A 
href="http://topic.csdn.net/t/20040727/09/3213235.html#">Top</A></P>
<H3><STRONG><A class=anchor name=r_22676853>13 楼</A>yulincao(csdnlover)<INPUT class=user1 title="一级用户 该版得分小于等于100分" type=button></STRONG><SPAN>回复于 
2004-07-27 12:26:22 得分 0 </SPAN></H3>
<P>还是不行<A href="http://topic.csdn.net/t/20040727/09/3213235.html#">Top</A></P>
<H4><STRONG>相关问题</STRONG></H4>
<DIV class=relation>
<UL>
  <LI><A href="http://topic.csdn.net/t/20050710/13/4134741.html" 
  rel=external>文本框中如何限制输入字符长度?</A> 
  <LI><A href="http://topic.csdn.net/t/20050728/21/4175174.html" 
  rel=external>文本框CEdit能否限制输入字符串长度?</A> 
  <LI><A href="http://topic.csdn.net/t/20050929/19/4302665.html" 
  rel=external>多行文本框如何限制输入长度</A> 
  <LI><A href="http://topic.csdn.net/t/20051024/10/4345757.html" 
  rel=external>如何限制Edit文本框接收字符的长度</A> 
  <LI><A href="http://topic.csdn.net/t/20021206/13/1237165.html" 
  rel=external>文本框限制</A> 
  <LI><A href="http://topic.csdn.net/t/20050118/09/3733695.html" 
  rel=external>如何在客户端限制多行文本框输入字符长度?</A> 
  <LI><A href="http://topic.csdn.net/t/20060210/09/4548628.html" 
  rel=external>文本框的长度问题</A> 
  <LI><A href="http://topic.csdn.net/t/20050201/15/3768660.html" 
  rel=external>如何限制文本框的输入</A> 
  <LI><A href="http://topic.csdn.net/t/20020128/17/504625.html" 
  rel=external>如何用jsp给文本框付值?</A> 
  <LI><A href="http://topic.csdn.net/t/20021015/15/1098660.html" 
  rel=external>请问如何在DataGrid的EditCommandColumn里,用什么属性可令按编辑时出现的文本框能限制长度?</A> 
</LI></UL></DIV></DIV></DIV>
<DIV id=sidebar>
<H3>关键词</H3>
<DIV></DIV>
<H3>得分解答快速导航</H3>
<DIV>
<UL>
  <LI>帖主:<A 
  href="http://topic.csdn.net/t/20040727/09/3213235.html#Top">yulincao</A> 
  <LI><A 
  href="http://topic.csdn.net/t/20040727/09/3213235.html#r_22669530">POwner</A> 
  <LI><A 
  href="http://topic.csdn.net/t/20040727/09/3213235.html#r_22669834">dannicklee</A> 

  <LI><A 
  href="http://topic.csdn.net/t/20040727/09/3213235.html#r_22675212">pengpong</A> 

  <LI><A 
  href="http://topic.csdn.net/t/20040727/09/3213235.html#r_22675347">chenhui9876</A> 

  <LI><A 
  href="http://topic.csdn.net/t/20040727/09/3213235.html#r_22676043">spiritsl</A> 
  </LI></UL></DIV>
<H3>相关链接</H3>
<DIV>
<UL>
  <LI><A href="http://java.csdn.net/" target=_blank>CSDN Java频道</A> 
  <LI><A 
  href="http://www.dearbook.com.cn/Book/SearchBook.aspx?sortid=4&amp;sorttype=smallsort" 
  target=_blank>Java类图书</A> 
  <LI><A href="http://www.codechina.net/resource/sort.php/21" 
  target=_blank>Java类源码下载</A> </LI></UL></DIV>
<H3>广告也精彩</H3>
<DIV>
<SCRIPT 
src="jsp中如何是文本框中只能输入英文,并限制其长度 Java - Web 开发 - CSDN社区 community_csdn_net.files/show_ads.js" 
type=text/javascript></SCRIPT>
</DIV>
<H3>反馈</H3>
<DIV>请通过下述方式给我们反馈<BR><IMG alt=反馈 
src="jsp中如何是文本框中只能输入英文,并限制其长度 Java - Web 开发 - CSDN社区 community_csdn_net.files/feedback.gif"></DIV></DIV>
<DIV class=clear></DIV></DIV>
<DIV class=CSDN-PHF id=CSDNPF>
<HR>
<A class=biaoshi 
href="http://www.hd315.gov.cn/beian/view.asp?bianhao=010202001032100010" 
rel=external>&nbsp;</A> 
<DIV><A href="http://www.csdn.net/intro/intro.asp?id=2" rel=external>网站简介</A>-<A 
href="http://www.csdn.net/intro/intro.asp?id=5" rel=external>广告服务</A>-<A 
href="http://www.csdn.net/map/map.shtm" rel=external>网站地图</A>-<A 
href="http://www.csdn.net/help/help.asp" rel=external>帮助</A>-<A 
href="http://www.csdn.net/intro/intro.asp?id=9" rel=external>联系方式</A>-<A 
href="http://job.csdn.net/Jobs/f9c75c9f2ad14404a604669b757b9ed0/viewcompany.aspx" 
rel=external>诚聘英才</A>-<A href="http://www.csdn.net/english/" 
rel=external>English</A>-<A 
href="javascript:navigate('mai'%20+%20'lto:'%20+%20'webm'%20+%20'aster@c'%20+%20'sdn.n'+'et?subject=向CSDN报告问题')" 
rel=external>问题报告</A></DIV>
<DIV>北京百联美达美数码科技有限公司&nbsp;&nbsp;版权所有&nbsp;&nbsp;京 ICP 证 020026 号</DIV>
<DIV>Copyright © 2000-2006, CSDN.NET, All Rights Reserved</DIV>
<SCRIPT 
src="jsp中如何是文本框中只能输入英文,并限制其长度 Java - Web 开发 - CSDN社区 community_csdn_net.files/counter.js" 
type=text/javascript></SCRIPT>

<SCRIPT 
src="jsp中如何是文本框中只能输入英文,并限制其长度 Java - Web 开发 - CSDN社区 community_csdn_net.files/clickeye.js"></SCRIPT>

<HR>
<!--google   Analytics begin -->
<SCRIPT 
src="jsp中如何是文本框中只能输入英文,并限制其长度 Java - Web 开发 - CSDN社区 community_csdn_net.files/urchin.js" 
type=text/javascript>
</SCRIPT>

<SCRIPT type=text/javascript>
_uacct = "UA-2688088-7";
urchinTracker();
</SCRIPT>
<!--google   Analytics end --><!-- Control Code/Caption.Yo-Focus-->
<SCRIPT language=JavaScript1.1>
var afp_keyword_BDA9CBA6_5658_A4DB_7E1D_1B781AF3DEE8 = "";
if (document.title != "")
	afp_keyword_BDA9CBA6_5658_A4DB_7E1D_1B781AF3DEE8 = document.title;
if (window.keywords)
	afp_keyword_BDA9CBA6_5658_A4DB_7E1D_1B781AF3DEE8 += window.keywords.content;
if (window.description)
	afp_keyword_BDA9CBA6_5658_A4DB_7E1D_1B781AF3DEE8 += window.description.content;

if (document.innerTEXT)
	afp_all_keyword_BDA9CBA6_5658_A4DB_7E1D_1B781AF3DEE8 = document.innerTEXT;

if(afp_keyword_BDA9CBA6_5658_A4DB_7E1D_1B781AF3DEE8.length > 273) 
{
	afp_keyword_BDA9CBA6_5658_A4DB_7E1D_1B781AF3DEE8 = afp_keyword_BDA9CBA6_5658_A4DB_7E1D_1B781AF3DEE8.substring(0,273);
}

document.write("<scr"+"ipt src='http://server.yoyi.com.cn/afp/get/;pl_id=BDA9CBA6_5658_A4DB_7E1D_1B781AF3DEE8;tp=js;sk=0;ck=0;ext_key="+afp_keyword_BDA9CBA6_5658_A4DB_7E1D_1B781AF3DEE8+";u_id=afu;ex_id=;/?'></scr"+"ipt>");
</SCRIPT>
<!-- Control Code End/No.csdn--></DIV></DIV></DIV></DIV></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -