1

I am using smartWizard (can be found here http://techlaboratory.net/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.org/)

I tried

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

but no working !

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

Dipu Raj
  • 1,784
  • 4
  • 29
  • 37
Adnan
  • 1,379
  • 2
  • 17
  • 24

2 Answers2

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!

Adnan
  • 1,379
  • 2
  • 17
  • 24
0

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

Dipu Raj
  • 1,784
  • 4
  • 29
  • 37
  • Hey does [jquery-validation](https://jqueryvalidation.org/) works on your smart wizard ?? – Daniyal Nasir Apr 28 '18 at 09:54
  • Hi Dipu, would you have a working example of SmartWizard 6 working together with Jquery Validation? Thank you. – b126 Sep 22 '22 at 14:37
  • @b126 here it is http://techlaboratory.net/projects/demo/jquery-smart-wizard/v6/validation#step-1 – Dipu Raj Sep 27 '22 at 08:11
  • 1
    Your demo is using the native HTML5 checkValidity() method, not the one from https://jqueryvalidation.org/ but in the meantime I managed to make it myself – b126 Sep 28 '22 at 12:46