phpjqueryformsformwizard

Want help in submitting tabbed form wizard


This is a simple script for creating a tabbed form, I copied from somewhere in the web. Whenever I submit, at the last step, it throws an alert, that the form has been submitted. I want the form to submit to the url in form's action. The calling class:

    $(".number-tab-steps").steps({
    headerTag: "h6",
    bodyTag: "fieldset",
    transitionEffect: "fade",
    titleTemplate: '<span class="step">#index#</span> #title#',
    labels: {finish: "Submit"},
    onFinished: function (a, b) {
        alert("Form submitted.")
    }
}), $(".icons-tab-steps").steps({
    headerTag: "h6",
    bodyTag: "fieldset",
    transitionEffect: "fade",
    titleTemplate: '<span class="step">#index#</span> #title#',
    labels: {finish: "Submit"},
    onFinished: function (a, b) {
        alert("Form submitted.")
    }
}), $(".vertical-tab-steps").steps({
    headerTag: "h6",
    bodyTag: "fieldset",
    transitionEffect: "fade",
    stepsOrientation: "vertical",
    titleTemplate: '<span class="step">#index#</span> #title#',
    labels: {finish: "Submit"},
    onFinished: function (a, b) {
        alert("Form submitted.")
    }
});
var form = $(".steps-validation").show();
$(".steps-validation").steps({
    headerTag: "h6",
    bodyTag: "fieldset",
    transitionEffect: "fade",
    titleTemplate: '<span class="step">#index#</span> #title#',
    labels: {finish: "Submit"},
    onStepChanging: function (a, b, c) {
        return b > c || !(3 === c && Number($("#age-2").val()) < 18) && (b < c && (form.find(".body:eq(" + c + ") label.error").remove(), form.find(".body:eq(" + c + ") .error").removeClass("error")), form.validate().settings.ignore = ":disabled,:hidden", form.valid())
    },
    onFinishing: function (a, b) {
        return form.validate().settings.ignore = ":disabled", form.valid()
    },
    onFinished: function (a, b) {
        alert("Submitted!")
    }
}), $(".steps-validation").validate({
    ignore: "input[type=hidden]",
    errorClass: "danger",
    successClass: "success",
    highlight: function (a, b) {
        $(a).removeClass(b)
    },
    unhighlight: function (a, b) {
        $(a).removeClass(b)
    },
    errorPlacement: function (a, b) {
        a.insertAfter(b)
    },
    rules: {email: {email: !0}}
}), $(".datetime").daterangepicker({timePicker: !0, timePickerIncrement: 30, locale: {format: "MM/DD/YYYY h:mm A"}});

Any Help would be deeply appreciated. Thanks


Solution

  • Done by changing

    alert("Submitted!")
    

    to

    return form.submit()