给一个不好的建议:把数字(0-9),字母(A-Z,a-z)及标点符号去掉。去看看别人是如何做的吧,很多什么免费申请表单中都能找到这方面的例子。
解决方案 »
- 请教state与status的区别
- 【请问】大量使用jQuery插件的弊端
- 求助啊,高手请进来。都急死了
- 当FORM的ENCTYPE="multipart/form-data" 时request.getParameter()获取不到值!
- 有无办法遍历函数里的所有变量?!
- 请教这段代码中的 get 是什么意思。
- 梅花大侠等高手进来!挑战性问题
- 关于客户端时间显示的问题?在线等待。。。。。
- 定义了一个marquee对象,怎样单击按钮时改变字体改色呢?
- 外行来送分啦!告诉我window.open后面的参数各是什么?
- 请问:JS中有没有判断字符串日期值是否有效的函数??象isDate(expression)这样的。
- javascrict中如何截取字符串中的部分字符?
但我不知道怎么写这个JS(以前是在下一页检验后显示的不适合的,但头儿说不方便)
:(
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>新網頁1</title>
</head><body>
<input name="T1" typt="text" value="I am a 中國人 , Are you 喜歡 ?" onblur="checktext()" style="width:300;border:1 solid blue">
</body>
<script language="javascript">
function checktext()
{
strS = document.all.T1.value;
if(checkchinese(strS) == false) alert(escape(strS));
}function checkchinese(strS)
{
strS = escape(strS);
var i=0 ;
while(i<strS.length)
{
if(strS.charAt(i)=="%")
{
if(strS.charAt(i+1)=="u")
{
i = i + 6;
}else{
i = i + 3;
}
}else{
return(false);
}
}
if(i <= strS.length-1) return(true);
}
</script>
</html>
<head>
<title> New Document </title>
<script>
function checkinput(obj)
{
if(event.keyCode<0xA0){
event.cancelBubble=true;
event.returnValue=false;
}
}
</script>
</head><body>
<input type=text onkeypress="checkinput(this)">
</body>
</html>
<head>
<title> New Document </title>
<script>
function checkinput()
{
if(event.keyCode<0xA0){
event.cancelBubble=true;
event.returnValue=false;
}
}
</script>
</head><body>
<input type=text onkeypress="checkinput()">
</body>
</html>