日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

多個函數(shù)驗證同一表單_ASP教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

推薦:說說對象的復(fù)制
以下為引用的內(nèi)容: <% Dim oConn,oRs Set oConn = Server.CreateObject("ADODB.Connection") Set ors = Server.CreateObject("ADODB.R

表單在提交前我們通常會用客戶端JS對其內(nèi)容進(jìn)行驗證,通常都是寫一個函數(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>
<form id="form1" name="form1" method="post" action="default.asp" onsubmit="return check();">
<p>
<input name="aaa" type="text" id="aaa" />
</p>
<p>
<input name="bbb" type="text" id="bbb" />
</p>
<p>
<input type="submit" name="Submit" value="提交" />
</p>
</form>
</body>
</html>



那如果是用多個函數(shù)對表單進(jìn)行驗證,應(yīng)當(dāng)怎么寫函數(shù),怎么調(diào)用呢?其實也很簡單,如下例子:

以下為引用的內(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>
<form id="form1" name="form1" method="post" action="default.asp" onSubmit="return (check1() && check2());">
<p>
<input name="aaa" type="text" id="aaa" />
</p>
<p>
<input name="bbb" type="text" id="bbb" />
</p>
<p>
<input type="submit" name="Submit" value="提交" />
</p>
</form>
</body>
</html>



原文:http://www.mzwu.com/article.asp?id=1078

分享:ASP實例:利用緩存提高數(shù)據(jù)顯示效率
實例演示:先建立一個簡單的數(shù)據(jù)庫,寫個function讀取一下,寫入一個dim變量temp中: ASP代碼 以下為引用的內(nèi)容: <% Function DisplayRec

來源:模板無憂//所屬分類:ASP教程/更新時間:2008-08-22
相關(guān)ASP教程