怎樣限制只能中文輸入的方法。_ASP教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
推薦:ASP編程中15個(gè)非常有用的例子(二)8.強(qiáng)迫輸入密碼對(duì)話框 答把這句話放載頁面的開頭 % response.status=401 not Authorized response.end % 9 如何傳遞變量從一頁到另一頁 答 用HIDDEN類型來傳遞變量 % form method=post action=mynextpage.asp % for each item in request.form % input
function isCharsInBag (s, bag){
var i,c;
for (i = 0; i < s.length; i++)
{
c = s.charAt(i);//字符串s中的字符
if (bag.indexOf(c) > -1)
return c;
}
return "";
}
檢查函數(shù):
function ischinese(s)
{
var errorChar;
var badChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789><,[]{}?/+=|\\'\":;~!#$%()`";
errorChar = isCharsInBag( s, badChar)
if (errorChar != "" )
{
report=report+"請重新輸入中文\n";
return false;
}
return true;
}
分享:ASP編程中15個(gè)非常有用的例子(一)1.如何用Asp判斷你的網(wǎng)站的虛擬物理路徑 答 使用Mappath方法 p align=centerfont size=4 face=Arialb The Physical path to this virtual website is: /b/font font color=#FF0000 size=6 face=Arial %= Server.MapPath(\)% /font/p 2.我如何
相關(guān)ASP教程:
- asp FSO 讀寫文件本文件實(shí)現(xiàn)代碼
- asp中isNull、isEmpty和空字符串的區(qū)別
- asp獲取用戶真實(shí)IP地址的方法
- asp連接sqlserver數(shù)據(jù)庫實(shí)現(xiàn)代碼
- asp中正則表達(dá)式過濾html代碼函數(shù)
- asp中g(shù)et post提交表單區(qū)別
- 網(wǎng)頁模板:ASP內(nèi)建對(duì)象Request
- xmlhttp的open方法使用詳解
- ASP的常用的自定義函數(shù)大全
- asp中用for循環(huán)的一個(gè)小技巧
- eWebEditor v3.8 列目錄
- ASP無組件分頁實(shí)現(xiàn)思路及代碼
- 相關(guān)鏈接:
- 教程說明:
ASP教程-怎樣限制只能中文輸入的方法。
。