Also, this works fine if I use get as my method, but I need to be able to use post. I'm using $_REQUEST in the php script so it should work with either.
On Aug 20, 2:51 pm, eric k <eric.kittl...@gmail.com> wrote: > Hello! > > I've been using MooTools for some time but have never used it for > sending ajax requests. I have a php form which, when called directly > from the html page successfully sends an email, but i'd like to be > able to do this without navigating away from the current page. I add > the following event, which successfully stops the default send on > click event, but doesn't seem to be communicating with the php > script: > > $('emlForm').addEvent('submit', function(event) { > event.stop(); > var req = new Request({ > method: 'post', > url: 'http://www.website.com/send.php', > data: $('emlForm'), > onRequest: function() { alert('Request made...'); }, > onComplete: function(response) { alert('Result: ' + > response); } > }).send(); > }); > > Any help would be greatly appreciated. Thanks :-)