Back to myContactForm.com - Easy email form creation and processing for your web site
myContactForm.com - Help Forum Forum Index myContactForm.com - Help Forum
Have a question that you need answered about myContactForm.com? Post it on this message board but first search this forum and read out FAQ to ensure it has not already been answered. This is not a board to post links to your site! SPAM will be deleted!
 
   Search MessagesSearch Messages
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Catch email validation on server side

 
Post new topic   Reply to topic    myContactForm.com - Help Forum Forum Index -> Errors When Submitting Forms
View previous topic :: View next topic  
Author Message
Julicun



Joined: 21 Jun 2013
Posts: 2

PostPosted: Mon Nov 04, 2013 11:19 pm    Post subject: Catch email validation on server side Reply with quote

Hello,

I'm submitting my contact form with ajax after validating with jquery plugin. The ajax submit triggers a paypal form submission, which is hidden on the same page and which redirects to paypal.com.

I have removed mycontactform.com php validation off all form fields except "email" (it's not possible right?) but if "email" is invalid through mycontactform.com validation, the paypal form submission and redirection is fired even though but without the ajax (mycontactform).

This is my submithandler:

submitHandler: function() {
$.post($("#contactForm").attr("action"), $("#contactForm").serialize(), function(data) {
$('#submit_btn').html(data);
if(data == 'FAIL'){
alert("Invalid email address");
} else {
$("#paypal").submit();
}
});
return false;
}

I'm looking for the send.php (mycontactform) echo that results from an invalid email input, something like this:

if(mail($invalid)){
echo "FAIL";
}else{
echo "success";
}

I 'm supposing that I could include the correct echo to if(data == 'FAIL'){ alert("Invalid email address"); and catch it before being redirected to paypal without mycontactform submission.

For any help, thank you!
Back to top
View user's profile
mycontac
Site Admin


Joined: 31 Dec 2003
Posts: 2684

PostPosted: Tue Nov 05, 2013 4:12 am    Post subject: Reply Reply with quote

Yes, the email validation is required. Unfortunately, I can't really help with your other queries.

Nick Ladd
myContactForm.com
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    myContactForm.com - Help Forum Forum Index -> Errors When Submitting Forms All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.11 © 2001, 2002 phpBB Group