How to submit form data to php using Twitter Bootstrap Wizard

1.8k Views Asked by At

I'm using http://vadimg.com/twitter-bootstrap-wizard-example/#docs and I am having difficulty finding how to submit the data to the backend php script.

Once I have initialised the Wizard I have tried to add into the options being passed to the method a submitURL (I read somewhere it could be set as var wizard = $("#some-wizard").wizard({submitUrl: "/some_url"});

I have also tried the following :

var wizard =  FormWizard.init();

$('#form_wizard_1 .button-submit').click(function (wizard) {
        $.ajax({
            url: "local_tmf_setup.php",
            type: "POST",
            data: wizard.serialize(),
            success:function(){
                alert('success.');
            }
        });               
     }).hide();

But it fails on the serialize method.

I've also looked at the documentation here: https://github.com/VinceG/twitter-bootstrap-wizard to see if there is an onSubmit event that the options could be passed to, but it appears the only event is onLast which I have tried as well.

Any ideas?

1

There are 1 best solutions below

0
On

My wizard contains information stored in a knockoutJS view model, so I just write it to the backend using a normal ajax / JSON call. Would that be an idea? I was not aware that the wizard even had a submit parameter.