Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Step Form Validation

$
0
0
I'm creating a form that is split up into 5 steps.

By the way this is just one form - and not 5 separate forms. I have a continue button on each step, which is just an image button - when you click on the image button it hides the current step and displays the next step.

$('#step-2-continue-button').click(function(){
    $('#step-1').hide();
    $('#step-2').fadeIn();
});


Now I need to perform AJAX validation on each step. I have read that I can use
$model->validate();
and specify the attributes but how do I do this on each step? As I am not actually submitting the form on each step, how do I make the image button call the validation function?

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>