I have a page with job opportunities when I click on a button it calls a modal and displays a form where sending information requires that he does not reload the page and displays a confirmation message.
What has happened is that after it is sent, it closes the modal and if I click the button to register it loads the sent message.
I'mtryingtouseAjax,butI'mnothavingsuccess!
$("#form1").submit(function(event){
// event.preventDefault(); //prevent default action
var post_url = $(this).attr("action"); //get form action url
var request_method = $(this).attr("method"); //get form GET/POST method
var form_data = $(this).serialize(); //En
$.ajax({
url : post_url,
type: request_method,
data : form_data
}).done(function(response){
alert('acabou');
});
});