I,m using SmartWizard in my project for getting the user registered with my web site. But i want to save all the data at the step 3 where the wizard has four steps. The wizard submits the form after clicking the finish button. Below code will describe my assumptions and can any one suggest a way to do this. Thanks.
function validateAllSteps(){
var isStepValid = true;
if(validateStep1() == false){
isStepValid = false;
$('#wizard').smartWizard('setError',{stepnum:1,iserror:true});
}else{
$('#wizard').smartWizard('setError',{stepnum:1,iserror:false});
}
if(validateStep2() == false){
isStepValid = false;
$('#wizard').smartWizard('setError',{stepnum:2,iserror:true});
}else{
$('#wizard').smartWizard('setError',{stepnum:2,iserror:false});
}
return isStepValid;
}
function validateSteps(step){
var isStepValid = true;
// validate step 1
if(step == 1){
if(validateStep1() == false ){
isStepValid = false;
$('#wizard').smartWizard('showMessage','Please correct the errors in step'+step+
' and click next.');
$('#wizard').smartWizard('setError',{stepnum:step,iserror:true});
}else{
$('#wizard').smartWizard('setError',{stepnum:step,iserror:false});
}
}
// validate step 2
if(step == 2){
if(validateStep2() == false ){
isStepValid = false;
$('#wizard').smartWizard('showMessage','Please correct the errors in step'+step+
' and click next.');
$('#wizard').smartWizard('setError',{stepnum:step,iserror:true});
}else{
$('#wizard').smartWizard('setError',{stepnum:step,iserror:false});
}
}
return isStepValid;
}
//start of step one validation
//end of of step one validation
//step 2 validation
//end of step 2 validation
var res=validateAllSteps();
if(res == true)
{
$('#form1').submit();
}