Aug 2nd, 2009, 11:19 AM
Thanks for the reply Ben, I'll give that a shot shortly and let you know how it works out. Very much appreciated
(Aug 2nd, 2009, 11:06 AM)Ben Wrote: Hey Jason,
Interesting stuff! There's certainly no reason why this shouldn't work - all FT cares about is the POST request, so it can be sent from anywhere - Ajax, Flash, HTML form, a handcrafted HTTP request - anything's fine.
Looking over your code, everything looks perfectly okay except that you'll need to tweak the syntax a little for the POST request. jQuery lets you send GET requests by appending the values to the URL, but POST requests have to be sent by sending them via a "data" property of the anonymous object passed to the $.ajax() function.
In other words, try tweaking your code to this:
Code:var dataString = 'form_tools_initialize_form=1&form_tools_form_id=3&name='+ name + '&email=' + email + '&phone=' + phone + '&company' + company + '&message' + message;
$.ajax({
type: "POST",
data: dataString,
url: "{path to}/process.php",
success: function() {
$('#contact_form_wrap').html("<div id='message'></div>");
$('#message').html("<h2>Contact Form Submitted!</h2>")
.append("<p>We will be in touch soon.</p>").hide().fadeIn(1500, function() {
$('#message').append("<img id='checkmark' src='images/check.png' />");
});
}
});
I *think* that should work, but don't quote me...
- Ben