why does my symfony2 Form not submit? when I click on the submit button, the error message I declare displays !
$(document).ready(function(){
$("#addemail").submit(function(){
var mail = $("#email").val() ;
$.ajax({
type : "POST",
url : "{{ path('store_mailListe') }}",
data : {
email : mail
},
success : function(data){
alert(mail);
if (data === "true") {
alert(data);
$("#email-true").html('<div class="b-shortcode-example"><div class="b-alert-success f-alert-success"><div class="b-right"><i class="fa fa-times-circle-o"></i></div><div class="b-remaining"><i class="fa fa-check-circle-o"></i> Thank you!</div></div> </div>');
return true;
}else{
alert(data);
$("#email-true").html('<div class="b-shortcode-example"><div class="b-alert-success f-alert-success"><div class="b-right"><i class="fa fa-times-circle-o"></i></div><div class="b-remaining"><i class="fa fa-check-circle-o"></i> Sorry can you try again</div></div> </div>');
return false;
}
}
});
return false;
});
});
The alert(mail) show My email, but alert(data) show a HTML code of page.
in the controller a make print_r();die();
but nothing happening
Thanks for your help.