我有一个经过验证的向导表单,但是在表单提交时,我希望它在浏览器中不要使用ajax完成,但是成功提交表单后,它将在下面的代码中显示swal警报。我只添加了表单提交中的脚本部分...脚本已缩小。
var WizardDemo=function(){$("#add_wizard");var e,r,i=$("#addemp");return{init:function(){var n;$("#add_wizard"),i=$("#addemp"),(r=new mWizard("add_wizard",{startStep:1})).on("beforeNext",function(r){!0!==e.form()&&r.stop()}),r.on("change",function(e){mUtil.scrollTop()}),r.on("change",function(e){1===e.getStep()&&alert(1)}),e=i.validate({ignore:":hidden",rules:{firstName:{required:!0},lastName:{required:!0},dob:{required:!0},gender:{required:!0},mstatus:{required:!0},employeeLogo:{required:!0},employeeId:{required:!0},loginPassword:{required:!0},mobileNumber:{required:!0},personalEmail:{required:!0},rAddress:{required:!0},city:{required:!0},region:{required:!0},dateoFJoining:{required:!0},employementType:{required:!0},designationName:{required:!0},categoryName:{required:!0},grade:{required:!0},departmentName:{required:!0},idtype:{required:!0},icard:{required:!0},accountName:{required:!0},accountNumber:{required:!0},bankAccount:{required:!0},bankBranch:{required:!0}},messages:{"account_communication[]":{required:"You must select at least one communication option"},accept:{required:"You must accept the Terms and Conditions agreement!"}},invalidHandler:function(e,r){mUtil.scrollTop(),swal({title:"",text:"Please correct the errors in the form and submit again",type:"error",confirmButtonClass:"btn btn-secondary m-btn m-btn--wide"})}}),(n=i.find('[data-wizard-action="submit"]')).on("click",function(r){r.preventDefault(),e.form()&&(mApp.progress(n),i.ajaxSubmit({success:function(){mApp.unprogress(n),swal({title:"",text:"The application has been successfully submitted!",type:"success",confirmButtonClass:"btn btn-secondary m-btn m-btn--wide"})}}))})}}}();jQuery(document).ready(function(){WizardDemo.init()});