Jquery Modal Ask Before Submit
I have form where user will type his name(required), dob(not required) and before submit the form, there is a confirmation that indicated whether if he/she is sure to submit the fo
Solution 1:
Your submitHandler
function is wrong. Try this code hope it works.
$(document).bind("click", function (e) {
$("#createexperience").validate({
rules: {
"language[]": {
required: !0
}
}
, messages: {}
, submitHandler: function () {
return !1
}
, ignore: ".ignore"
, errorElement: "label"
, errorClass: "has-error"
, submitHandler: function (e) {
if ($.trim($('#namefield').val()) == '') {
$('#portfoliomsgmodal').modal('show');
$('#submitlater').click(function () {
e.submit();
});
} else {
e.submit();
}
}
, highlight: function (e) {
$(e).closest(".form-group").removeClass("success").addClass("has-error")
}
})
});
Post a Comment for "Jquery Modal Ask Before Submit"