I have a form which updates with more content after clicking submit. all elements for this part are already in DOM. I was having issues with $.post because it is asynchronous and tried switching to $.ajax but now nothing happens when I click submit on this part of the form.
Not working:
$.ajax({
type: 'POST',
url: 'functions/flow.php',
data: {
step: 3,
id: question_id
},
async: false
}).done(function(data) {
$('#fourth_step .form').append(data);
});
This works:
$.post("functions/flow.php", {
step: 3,
id: question_id
}, function(data) {
$('#fourth_step .form').append(data);
}
);
I tried using .fail to see if i got an error but nothing seems to happen, it just stops.
Thanks for the help.
1 Answer