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 🙄
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 🙄
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
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
This topic is locked and no more replies can be posted.