Closed rigond closed 12 years ago
Hi,
I assume that you are sending the form using ajax? If so, you can use the success callback function to take care of hiding the wizard and showing a success message (and close button). If you specifically need to show another step in the wizard when the form is successfully posted, just call e.g. $("#demoForm").formwizard("show", "success_step"); in the success callback.
e.g.
$(function(){
$("#demoForm").formwizard({
formPluginEnabled: true,
validationEnabled: true,
focusFirstInput : true,
formOptions :{
success: function(data){
$("#demoForm").formwizard("show", "success_step");
},
beforeSubmit: function(data){$("#data").html("data sent to the server: " + $.param(data));},
dataType: 'json',
resetForm: true
}
}
);
});
You can probably find suitable documentation for the show method etc at http://thecodemine.org/
Would this work for you?
Thanks for the quick reply! Yes I'm posting the form with ajax on each step. In the final step I summarise the form then submit it.
I would like to show a 'success_step' after submitting the form. I've tried your method above but, the formwizard counts the 'success_step' as the last step of the form and thus renders the submit button in the 'success_step' and not the step before.
Hi,
try adding the class="submit_step" to the step that should submit the form (thus the last step before the success_step)
Hope this should take care of it.
Yes this worked. Thank you very much!
Is it possible to add an after_submit step to the formwizard to perhaps show a success message and a close button?