I have a multistep form which is within a single form. I want to validate every single step, for eg. if i'm validating content inside div with id 1 then only that div validation should work but current scenario is the validation is not working if i have single form for all the steps and I don't want multiple forms to be validated. Is there any way to fulfill the above requirement?
<div>
<form name="" id="">
<div id="1"></div>
<div id="2"></div>
<div id="3"></div>
<div id="4"></div>
</form>
</div>
jQuery('form#addform select').each(function() {
jQuery(this).rules('add', {
required_select: true
});
});
jQuery.validator.addMethod('required_select', function(value, element) {
return value > 0;
}, 'Please choose a option');
jQuery("form#addform").validate({
submitHandler: function(form) {
// ...
}
});