[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Using  jquery Validation on jquery Smart Wizard plugin

Posted on 2013-06-16
5
Medium Priority
?
3,952 Views
Last Modified: 2013-06-28
Hi there,
I was wondering if anyone has done this before. Documentation on smart wizard tells me i can build custom validation for each step, but i want to use jquery validation. I wrote allt he rules i need for step one of the wizard and i triger the validation function on leave step but validation just doesnt trigger. Better said it doesnt show errors but once you fill in the required fields it gives them a green outline meaning they pass validation. Hope to hear from you soon and hope my question makes sense:D
Regards
0
Comment
Question by:webfactor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 39251590
Not at all without some code or a site
0
 

Author Comment

by:webfactor
ID: 39252849
$('#wizard-validation').smartWizard(
 {
  // Properties
    selected: 0,  // Selected Step, 0 = first step  
    keyNavigation: true, // Enable/Disable key navigation(left and right keys are used if enabled)
    enableAllSteps: false,  // Enable/Disable all steps on first load
    transitionEffect: 'fade', // Effect on navigation, none/fade/slide/slideleft
    contentURL:null, // specifying content url enables ajax content loading
    contentCache:true, // cache step contents, if false content is fetched always from ajax url
    cycleSteps: false, // cycle step navigation
    enableFinishButton: false, // makes finish button enabled always
    errorSteps:[],    // array of step numbers to highlighting as error steps
    labelNext:'Next', // label for Next button
    labelPrevious:'Previous', // label for Previous button
    labelFinish:'Finish',  // label for Finish button  
	enableSaveButton:false,
	hideButtonsOnDisabled:true,
	
	onLeaveStep:	function leaveAStepCallback(obj, context){
		
        if(context.toStep==2){
		validateRemovalistSetupWizzardStep1();
		
			
		}
	},
		
	
  // Events

    onShowStep:null,  // triggers when showing a step
    onFinish: storeRemovalistProfile  // triggers when Finish button is clicked
 }
); 

Open in new window

and this is the wizard init code ...
function validateRemovalistSetupWizzardStep1(){
	
var validator=$("#removalistSetup").validate({
		
  rules: {
    companyName: {
      required: true
	},abn:{
		required:true,
		digits:true
	},address:{
		required:true
	},city:{
		required:true
	},postalCode:{
		required:true,
		maxlength:4,
		digits:true
	},phone:{
		required:true,
		digits:true
	},mobile:{
		required:true,
		digits:true
	},contactPerson:{
		required:true
	},altMail:{
		email:true
	}
  }
});

Open in new window

These are the validation rules for step one that I trigger onLeaveStep of smart wizard.
You need smart wizards html code as well?
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 39253069
Is there anywhere I can see this in action?
0
 

Accepted Solution

by:
webfactor earned 0 total points
ID: 39265986
we fix the issue. thanks for your assistance anyway.

basicly what we did was applie the validation rules before initialising the wizard form and using .valid() function on leave step to check if all fields r filled in
0
 

Author Closing Comment

by:webfactor
ID: 39283807
we fixed it ourselfs
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question