Forums

Chronoforms V5 check for duplicate email

salsaweb 04 Jun, 2014
Hi, in CF v4 I used Auto validation Server Side for check if email exist. How i do in CF 5?
I try this:
Setup--->OnSubmit, after Check Captcha I insert Server Validation (from validation box) and in fail i insert an event loop. In the email box of Server validation i put this code:
<?php
$db =& JFactory::getDBO();
$query = "
SELECT COUNT(*)
FROM `mytable`
WHERE `email` = '{$form->data['email']}' ;
";
$db->setQuery($query);
$count = $db->loadResult();
if ( $count ) {
$form->validation_errors['email'] = "Used email.";
return false;
}
?>
But not work! 😟
help me please!
Sorry for my english 🙄
Max_admin 05 Jun, 2014
Hi salsaweb,

In v5 you should use the "Event switcher" under "Validation".

Your code should be changed to return the "event name" instead, either "success" or "fail", we have a FAQ on this under FAQs > CFv5

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.