0

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>
2
Contributors
2
Replies
24
Views
4 Years
Discussion Span
Last Post by adeeb.keyaam
1

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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.