Forums

How to avoid submissions from certain domain extensions?

baxterdown 27 Nov, 2020
Hi everyone,

I have a couple of CFv5 installations where the forms are being abused with submissions from emails with .ru email addresses (i.e.name@xyz.ru). How do I setup email validation where if the email address has .ru extension the form will not submit?

I am not a programmer so if the setup requires code, I would appreciate step-by-step instructions.

Thank you in advance for you assistance!

Jose
Max_admin 29 Nov, 2020
Answer
Hi Jose,

In v5 I think that you will need some PHP code to test the email address in the data:
if(strpos($this->data["email_field_name"], ".ru") !== false){
//redirect
}
in v7 there is a validation rule for "does not contain", which you can use to block certain string
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
baxterdown 29 Nov, 2020
Hi Max.

Thanks for the info. I looked on several places and couldn't figure out where to put it. If I recall correctly (I might be incorrect), it should not go in the Form Code tab because that gets rewritten every time the form is edited.

Where do I add the PHP code?

Thanks for your help,

Jose
Max_admin 04 Dec, 2020
Hi Jose,

In a PHP action!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
You need to login to be able to post a reply.