I don\'t know PHP.
I don\'t want the user to go to http://www.example.com/feedback-thanks.html
after sending the form. What I want is text below the sen
You will have to use $.ajax()
for that
this is what I use in one of my apps
$('#submitSearch').click(function() {
var formData = {
searchData: $('#searchData').val(),
};
$.ajax({
url: siteUrl + 'fetch/search',
type: "POST",
data: formData,
cache: true,
beforeSend:function(){
jQuery('#main').html('');
},
success: function(data) {
jQuery('#main').empty();
jQuery('#main').append(data);
},
error:function(x,e){
if(x.status==0){
alert('You are offline!!\n Please Check Your Network.');
}else if(x.status==404){
alert('Requested URL not found.');
}else if(x.status==500){
alert('Internel Server Error.');
}else if(e=='parsererror'){
alert('Error.\nParsing JSON Request failed.');
}else if(e=='timeout'){
alert('Request Time out.');
}else {
alert('Unknow Error.\n'+x.responseText);
}
}
});
return false;
});