You need to enter the following into the 2nd textarea in the form properties tab under "PHP Scripts":
$formId = 0; // CHANGE THIS VALUE to your form ID
$db = JFactory::getDbo();
$query = $db->getQuery();
$query
->select("*")
->from("__rsform_submission_values")
->where("FormId = " . $db->q($formId))
->where("FieldValue = " . $db->q($_POST['form']['email_address'] ));
$db->setQuery($query);
$db->execute();
$num_rows = $db->getNumRows();
// We found this email in the submissions
if ($num_rows > 0) {
$invalid[] = RSresolveComponentName('email_address', $formId);
echo RSshowForm($formId, $_POST['form'], $invalid);
}
You could also create a new validation rule by adding this function to this file: components/com_rsform/controller/validation.php, which can be selected by editing the email_address field and selecting "unique" as the Validation Rule.
function unique($param, $extra=null)
{
$db = JFactory::getDBO();
$param = $db->getEscaped($param);
$db->setQuery("SELECT * FROM #__rsform_submission_values WHERE `FieldName`='email_address' AND `FieldValue`='".$param."'");
$db->query();
$invalid = $db->getNumRows();
if ($invalid)
return false;
return true;
}
There is a little more documentation on custom validations on this page.
https://www.rsjoomla.com/support/documentation/rsform-pro/customizing-rsform-pro/custom-validation-rules.html
This thread might also prove helpful: https://www.rsjoomla.com/forum/37-rsform-pro/9162-setup-form-so-each-user-can-only-submit-once-.html
EDIT:
This answer is old and most likely obsolete, I no longer do Joomla development.