- Impact
- 18
Hi there, I've got an email form on my website and this jquery code:
When the form is submitted, I get an email through, so I know that the data is being sent to email.php, and is getting mail()ed to me perfectly fine. The problem is that the function being called under the "success: " bit isn't firing (as it were). So, even though it obviously works fine, connects to email.php and sends the email, its not displaying an alert, or changing the content of the #note div etc.
I can't find any problem here at all, its very strange.
Thanks
Tom
---------- Post added at 11:49 PM ---------- Previous post was at 10:48 PM ----------
just re-did it from scratch and it all seems to be working now... I don't know what I did the first time to make it stop working. lol
if anyone can see it I'd quite like to know thank you. :s
HTML:
$('#emailForm').submit(
function(){
var str = $(this).serialize();
$.ajax({
type: 'POST',
url: 'email.php',
data: str,
sucess: function(msg){
alert('Works');
$('#note').ajaxComplete(
function(event, request, settings){
if(msg == 'OK') {
result = '<div class='notification_ok'>Your message has been sent. Thank you!</div>';
$('#fields').hide();
}
else{
result = msg;
}
$(this).html(result);
}
);
}
});
return false;
}
);
I can't find any problem here at all, its very strange.
Thanks
Tom
---------- Post added at 11:49 PM ---------- Previous post was at 10:48 PM ----------
just re-did it from scratch and it all seems to be working now... I don't know what I did the first time to make it stop working. lol
if anyone can see it I'd quite like to know thank you. :s








