Clicking previous in an ajax enabled form goes forward
Hi
I'm trying to AJAX enable a form with several pages. I did this piece of js:
function bindContour() {
//currentForm and other variables, is of course defined in the function
currentForm.find("form").on("submit", function (e) {
e.preventDefault();
var form = $(this);
if (form.data('submitted') === true) {
// Previously submitted - don't submit again
} else {
if (form.valid()) {
// Mark it so that the next submit can be ignored
$.ajax({
url: $(this).attr('action'),
type: 'POST',
cache: false,
data: new FormData(this),
processData: false,
contentType: false,
success: function (data) {
var newform = $(data).find("#" + modalId);
modalContent.html(newform.html());
bindContour();
}
})
}
else {
}
}
The first submission works fine, the second also works (if only you go forward). If I click Previous, the form just acts like I clicked next.
Clicking previous in an ajax enabled form goes forward
Hi
I'm trying to AJAX enable a form with several pages. I did this piece of js:
The first submission works fine, the second also works (if only you go forward). If I click Previous, the form just acts like I clicked next.
Is there something I'm missing?
is working on a reply...