I got a problem when I'm using bootbox in jquery.validate, if I put bootbox.confirm into submitHandler, the submit button's value will be lost in the backend
JS code:
$(function () {
$("#userForm").validate({
submitHandler: function (form) {
bootbox.confirm('are you sure?', function (result) {
if (result) {
form.submit();
}
})
}
});
})
data got in backend:
Array
(
[username] => james
)
if I remove the bootbox.confirm, like:
$(function () {
$("#userForm").validate({
submitHandler: function (form) {
form.submit();
}
});
})
it shows:
Array
(
[username] => james
[submitButton] => Submit
)
Anyone knows why and how to solve this problem? Thanks a lot.