【发布时间】:2017-05-11 07:26:46
【问题描述】:
我试图强制提交我的表单,问题是我使用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;
});
如何避免此问题并保留对所需输入的验证?
【问题讨论】:
-
您能否进一步澄清问题!
-
问题是我不知道如何在做了一些事情后强制提交表单(请参阅我的问题中的 JavaScript 代码)。
标签: javascript jquery html forms form-submit