admin管理员组

文章数量:1391995

I am using smartWizard (can be found here ) and now want to validate the form using jQuery validate plugin (can be found here / or here /)

I tried

$('#wizard').smartWizard({
    onFinish: function() {
        $("form").validate();
    }
});

but no working !

I am using .validate() only because i passed the rules in HTML attributes!

I am using smartWizard (can be found here http://techlaboratory/smartwizard) and now want to validate the form using jQuery validate plugin (can be found here http://bassistance.de/jquery-plugins/jquery-plugin-validation/ or here http://jqueryvalidation/)

I tried

$('#wizard').smartWizard({
    onFinish: function() {
        $("form").validate();
    }
});

but no working !

I am using .validate() only because i passed the rules in HTML attributes!

Share Improve this question edited Nov 1, 2016 at 10:47 Dipu Raj 1,8944 gold badges33 silver badges39 bronze badges asked Apr 5, 2014 at 10:30 AdnanAdnan 1,4092 gold badges18 silver badges24 bronze badges 0
Add a ment  | 

2 Answers 2

Reset to default 3

Well guys i found the answer; How we will use jQuery Validation with smartWizard? Simply submit the form on "onFinish" call back of smartWizard, put .validate(); in the page where ever you want. Validation plugin executes on the form submission, smartWizard does not submit the form. It actually tell you that user is at the last step of wizard and just clicked the Finish button.

$('#wizard').smartWizard({
    onFinish: function() {
       $("form").submit();
    }
});

$("form").validate({
    rules: {
        username: "required"
    }
});

There are many ways to apply a rule in jQuery Validation, above is one of them!

Latest version (SmartWizard 4.x) have an implementation with jQuery validator plugin. Check this demo Smart Wizard: Demo Input Validation

Also see jQuery Smart Wizard v6 Form Validation Demo

本文标签: javascriptsmartWizard and jQuery validateStack Overflow