我想提交我的表格 - 通過smoke選項(bootstrap 2.0.3)批准了一個確認窗口後。直到我插入驗證後,這個工作才完成,但現在,即使您確認 - 沒有任何反應。表單不提交。通過煙確認提交表單jQuery驗證
這裏是我的代碼,嘗試了幾個選項。
你的眷顧是感激!
$("#enroller").validate({
submitHandler: function() {
//tried also: submitHandler: function(form) {
var selectedCount = $(".gradeOption[value!='']").length;
var questionAmount = selectedCount; // count how many fields were filled
smoke.confirm('you are about to submit '+questionAmount+' grades - please confirm.',function(e){
if (e){
$("#enroller").submit();
//tried also: $(form).submit();
}else{
smoke.alert('save was cancelled', {ok:"close"});
}
}, {ok:"yes - save", cancel:"cancel"});
} //submitHandler
}); //validate
顯示代碼的其餘部分。你不會多次調用'validate()',是嗎?關於相關的HTML標記呢?你在'