最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - smartWizard and jQuery validate - Stack Overflow

programmeradmin2浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论