I want to create a form wizerd or a multi step form, there is a continue button to step forward, <button type="submit" name="continue" onclick="return validateNow();">Continue</button>
and a previus button to step backward, <button type="submit" name="continue" value="< Back">Previous</button>
, button type must be in submit format, because i have php in this code. when i press previous, it nicely takes me to form 1 but if i press continue button before previus button, then my previous button reacts like my continue button, even my reset button,<button type="reset">Clear</button>
can not unbind validators from from. for from validation i am using bvalidator, please give me sugession or ideas to overcome this problem...
function processStep2()
{
if ( isset( $_POST["continue"] ) and $_POST["continue"] =="< Back" )
{
displayStep1();
}
else
{
displayStep3();
}
}
<?php function displayStep1() { ?>
<?php include 'step_one.php'; ?>
<?php } ?>
<?php function displayStep2() { ?>
<?php include 'step_two.php'; ?>
<?php } ?>
<?php function displayStep3() { ?>
<?php include 'step_three.php'; ?>
<?php } ?>
<script type="text/javascript">
function validateNow() {
$('#add_info').bValidator();
};
</script>