0
I have a contact form that uses an AJAX function to validate and return a success PARAMETER that allows me to send the message WITHOUT the visitor leaving the contact page.
Normally, I use these Forms in HTML pages and the function PROCESSES and SENDS the message in the backend, without any intervention.
Works! but only if the server runs PHP.
On a WINDOWS server it does not work. This is because inside AJAX I will need to load the page that handles and sends the variables in email format. On a WINDOWS server I will need a classic ASP page.
The function in HTML works, in ASP works, but I can’t get ajax to send variables from FORM to the ASP page, so that ASP captures and treats the message.
I am going to paste here the section in question:
var dataString = '?name=' + name + '&email=' + email + '&message=' + message + '&fone=' + fone;
// alert (dataString);return false;
$.ajax({
type:"GET",
url:"contact.asp",
data:dataString,
success:function () {
$('#af-form').prepend("<strong>Sua mensagem foi enviada!</strong> Em breve entraremos em contato.<br> ");
$('#af-form')[0].reset();
}
});
return false;
If I create a PHP page with the same instructions as the ASP page, AJAX sends the data correctly (but obviously does not process).
So what I need to do is CHANGE the way the datastring content is being passed on. So, friends, just asking the college for help.
* ATTENTION * 1) Read the question carefully; 2) Refrain from "Okay, but why ASP?" 3) Suggest alternative paths, but try to maintain the integrity of the function. 4) Be kind and polite to those who know less than you.
[]'s
Helium, see if this link helps you: https://goo.gl/1ao3BR .
– devgirl
It’s an interesting approach (thank you!), but it assumes that my source document is an ASPX. Actually what I have in hand is an HTML.
– Helio Souza