欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

表單提交前觸發(fā)函數(shù)返回true表單才會(huì)提交

 更新時(shí)間:2014年03月11日 15:47:00   作者:  
這篇文章主要介紹了表單提交前觸發(fā)函數(shù)當(dāng)返回true表單才會(huì)提交的具體實(shí)現(xiàn),需要的朋友可以參考下
直接看代碼
復(fù)制代碼 代碼如下:

<form id="payForm" action="yeepaypay.html" target="_blank" method="post" onsubmit="return checkform();">

例子中的onsubmit函數(shù)即為表單提交前觸發(fā)的函數(shù)
復(fù)制代碼 代碼如下:

function checkform() {
var value = $("input[name='payWay']:checked").val();
if (value == 1) {
$("#alipayment").submit();
return false;
}
return true;
}

如果返回true表單才會(huì)提交,否則不提交

相關(guān)文章

最新評(píng)論