多個(gè)函數(shù)驗(yàn)證同一表單_ASP教程
推薦:說說對(duì)象的復(fù)制以下為引用的內(nèi)容: <% Dim oConn,oRs Set oConn = Server.CreateObject("ADODB.Connection") Set ors = Server.CreateObject("ADODB.R
表單在提交前我們通常會(huì)用客戶端JS對(duì)其內(nèi)容進(jìn)行驗(yàn)證,通常都是寫一個(gè)函數(shù)然后在onsumbit事件中調(diào)用,如下:
以下為引用的內(nèi)容: <html> <head> <script language="javascript"> function check() { if(form1.aaa.value == ""){return false;} if(form1.bbb.value == ""){return false;} return true; } </script> </head> <body> |
那如果是用多個(gè)函數(shù)對(duì)表單進(jìn)行驗(yàn)證,應(yīng)當(dāng)怎么寫函數(shù),怎么調(diào)用呢?其實(shí)也很簡(jiǎn)單,如下例子:
以下為引用的內(nèi)容: <html> <head> <script language="javascript"> function check1() { if(form1.aaa.value == "") { return false; }else{ return true; } } function check2() { if(form1.bbb.value == "") { return false; }else{ return true; } } </script> </head> <body> |
原文:http://www.mzwu.com/article.asp?id=1078
分享:ASP實(shí)例:利用緩存提高數(shù)據(jù)顯示效率實(shí)例演示:先建立一個(gè)簡(jiǎn)單的數(shù)據(jù)庫,寫個(gè)function讀取一下,寫入一個(gè)dim變量temp中: ASP代碼 以下為引用的內(nèi)容: <% Function DisplayRec
- 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教程-多個(gè)函數(shù)驗(yàn)證同一表單
。