Rapidwewaver Contact page not validating submitted email address

Hi there.

I am using the standard Contact page, including a field for email address. Some users do not type a valid email (most mistakes are writing a surname in that field), so I can’t reply to their question.

The mailer.php script does validate the email (looking for a @ and a dot), but does not warn the user that the email address they have typed is invalid. Instead it just substitutes the form’s owners email address.

I think if we choose to use an email field, the form should validate the submitted email, and then warn the user if the email address is not valid. I have added the following code to my version of mailer.php:

   	//check user-type valid email
if (! check_email($submitted_email)) {
		redirect($return_url, 'The email address you have typed is not valid. Please try again.');
}

Could this be included in future releases, at least as an option??

cheers
Rob in Australia

2 Likes

Hi embert
Sorry for the dumb questions (new to RW), but where exactly do I enter this code to have the email address validated??

@ianm This should help: Contact Form not validating email address

Hi thang, yes I saw that but here do I find the mailer.php

mailer.php will be in the folder on your +hosted, published site+ at:
contact-form > files > mailer.php
You can access that with an ftp program or the control panel on your hosting service. This method does work, however you will have to re-upload the modified mailer.php file every time you update your RW project, as RW will overwrite the modified mailer.php with it’s own default mailer.php each time you re-publish.

A solution is to use a contact form stack with the YourHead Stacks plug-in. It’s hard for me to imagine using RW without the Stacks plug-in.

Stellar Stacks Contact Form stack is very good, easy to set up, and a great deal at $4.50.
http://www.stellarstacks.com/stacks/contact-form/

For more flexibility FormSnap from Yabdab is great:
http://yabdab.com/stacks/formsnap

Hope that helps.

Thanks thang, you are a star.

You’re welcome - glad it helped.