I am new to jquery/ajax and have a template that uses jquery-steps. How do I read/process a json response from the server after the form has submitted?
I know how to do it in a basic form with the following by calling the showResponse function:
var options = {
dataType: 'json',
success: showResponse, // post-submit callback
};
$('#form').ajaxForm(options);
But I am unable to get this integrated with the jquery-steps plugin which goes something like this:
$("#form").steps({
bodyTag: "fieldset",
onStepChanging: function (event, currentIndex, newIndex)
{
...............
},
onStepChanged: function (event, currentIndex, priorIndex)
{
...........
},
onFinishing: function (event, currentIndex)
{
........
},
onFinished: function (event, currentIndex)
{
var form = $(this);
// Submit form input
form.submit();
}
}).validate({
errorPlacement: function (error, element)
{
element.before(error);
},
rules: {
confirm: {
equalTo: "#password"
}
}
});
Basically, I need help to be able to call the "showResponse" function after the form is submitted. Any help is much appreciated!