• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Email Validation with work place email address

Email Validation with work place email address 6 years 7 months ago #37261

  • saman6
  • saman6's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
How to validate email field allow to submit my from who has workplace email address and Not allow to submit who has free email accounts (gmail, yahoo etc)
The administrator has disabled public write access.

Email Validation with work place email address 6 years 7 months ago #37263

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

You can try using the $invalid method with a script added via "Scripts Called On Form Process" area (while editing a form > Properties > PHP Scripts):
$emailName = 'myEmailFieldNameHere';
$allowedDomains = array("workplace.com","another.net");
 
$verify = explode("@",strtolower($_POST['form'][$emailName]));
 
if(!in_array($verify[1], $allowedDomains)){
	$invalid[] = RSFormProHelper::getComponentId($emailName);
}

Replace myEmailFieldNameHere with the exact name of your email field (case sensitive) and the array items from the $allowedDomains as desired.
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!