我試圖強制提交我的表單,問題是我使用bootboxjs (即使用異步代碼)在提交前進行確認對話框,這正是我想要的,也是以這種方式驗證所需的輸入。如何強制提交 - 提交事件中的異步代碼
這是我的JS代碼結構:
$("#myForm").submit(function(e){
bootbox.confirm({
message: "Are you sure?",
buttons: {
confirm: {
label: 'Yes',
className: 'btn-danger'
},
cancel: {
label: 'NO, STOP!',
className: 'btn-primary'
}
},
callback: function (result){
if (result)
{
// Some code to set values to hidden inputs and another irrelevant stuff...
// The right command (that I didn't know) to force the form
}
}
});
return false;
});
我怎樣才能避免此問題並保留所需投入的驗證?
你能澄清更多的問題瀏覽器的默認提交! – PacMan
問題是,我不知道如何在做一些事情後強制**提交表單(請參閱我的問題中的JavaScript代碼)。 – candlejack