如果确认为真,我正在尝试调用另一个 jQuery 函数,代码如下:
jQuery("#adminForm_1").submit(function () {
var empty = false;
jQuery(":input", "#adminForm_1").each(function () {
empty = (jQuery(this).val() == "") ? true : empty;
});
if (empty) {
if (confirm('You have not filled out all of the fields, do you wish to continue?')) {
jQuery("#adminForm_1").validationEngine({
ajaxSubmit: true,
ajaxSubmitFile: "/index.php?option=com_database&view=tripdetails&Itemid=12&client=1&task=save",
ajaxSubmitMessage: "Client Trip Details Saved",
inlineValidation: false,
success: false,
failure: function () {}
});
} else {
return false;
};
}
});
^^ 上面的代码不起作用,但你会看到我想要做什么..