Hello Reader's If you need to make ajax request that send the email in backgournd page then you can use the code below:-
$('#submit').click(function() //specify your selector of form
{
$.ajax({
url: sendemail.php, // your action page
type:'POST',
data:
{
email: emailaddress,
message: message
},
success: function(msg)
{
alert('Email Sent');
}
});
});
Benefit of using this page is your current page will not be refreshed. While the form is submitted via POST
0 Comment(s)