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="&lt; 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>

Care to share your solution?

I attached a javascript function to my submit button, which is named previous.

function validateOff() {
    jQuery('#add_info').unbind('submit');
};

<button type="submit" name="previous" onClick="return validateOff();" value="&lt; Back">Previous</button>

and then problem is solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.