Fw: [問題] onsubmit無效
※ [本文轉錄自 Web_Design 看板 #1GE8z-Lz ]
作者: herman602 (奸商) 看板: Web_Design
標題: [問題] onsubmit無效
時間: Sat Aug 25 16:40:26 2012
以下是我的程式碼
主要問題是rsp.success返回true的時候
表單還是無法submit出去....
有誰知道原因嗎....
謝謝!
<script type="text/javascript">
var ajaxCheck = function(customForm) {
// fetch the data for the form
var data = $(customForm).serializeArray();
// setup the ajax request
$.ajax({
type: "POST",
dataType: 'json',
url: "check.php",
data: data,
cache: false,
success: function(rsp){
if (rsp.success == true)
return true;
else
return false;
}
});
return true;
}
</script>
<form method="post" id="customForm" name="customForm" action="submit.php"
onsubmit="return ajaxCheck(this);">
...(略)
<input type="submit" id="send" name="send" value="送出" />
</form>
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 219.68.58.22
※ 發信站: 批踢踢實業坊(ptt.cc)
※ 轉錄者: herman602 (219.68.58.22), 時間: 08/25/2012 16:40:44
→
08/25 17:33, , 1F
08/25 17:33, 1F
→
08/25 17:43, , 2F
08/25 17:43, 2F
推
08/25 18:20, , 3F
08/25 18:20, 3F
→
08/25 18:42, , 4F
08/25 18:42, 4F
→
08/25 18:42, , 5F
08/25 18:42, 5F
→
08/25 18:43, , 6F
08/25 18:43, 6F
→
08/25 18:43, , 7F
08/25 18:43, 7F
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章
-14
26