3

I have installed jQuery steps, and want to make a form with a step wizard. Problem is how to sumbit the form with PHP when the "Finish" button appears. All the code below works, exept the handling of the last submit.

My form example code:

<form method="POST" action="#" role="form">
    <div id="wizard">
        <h2>Info</h2>
        <section>
              <div class="form-group">
                <label for="text">Email address:</label>
                <input type="text" class="form-control" id="text">
              </div>
        </section>

        <h2>Second Step</h2>
        <section>
           //form stuff
        </section>

        <h2>Third Step</h2>
        <section>
           //form stuff
        </section>

        <h2>Forth Step</h2>
        <section>
            form stuff
        </section>
    </div>
</form>

Script that calls jQuery steps:

<script>
    $(function ()
    {
        $("#wizard").steps({
            headerTag: "h2",
            bodyTag: "section",
            transitionEffect: "slideLeft",
            stepsOrientation: "vertical"
        });
    });
</script>

Last i want to sumbit the form wizard to db using PHP:

<?php 
if(isset($_POST['submit'])){
    //save values
}

?>

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
sdfgg45
  • 1,232
  • 4
  • 22
  • 42

1 Answers1

2

The onFinished method can be used for submitting the form to the server

onFinished: function (event, currentIndex) {
    var form = $(this);
    // Submit form input
    form.submit();
},
Anh Pham
  • 2,108
  • 9
  • 18
  • 29