Hello,
first of all congrats to this really great Component.
I´m coming from version 3.1 RC5.5 in J 1.5 where the Server Side Validation (see code below) has worked well.
Now in J 1.7 and ChronoForms 4.0 RC3.0 the Server Side Validation didn´t work.
I wan´t to check if the field name or email already exist in Table #__chronoforms_data_Prinzentipp.
But when I put the following code in Custom Server Side Validation in my form on submit it will always store the data in Table, when the name or email is equal to one in the table, too.
Have anyone a suggestion for this problem.
Thanks a lot,
Jupp
first of all congrats to this really great Component.
I´m coming from version 3.1 RC5.5 in J 1.5 where the Server Side Validation (see code below) has worked well.
Now in J 1.7 and ChronoForms 4.0 RC3.0 the Server Side Validation didn´t work.
I wan´t to check if the field name or email already exist in Table #__chronoforms_data_Prinzentipp.
But when I put the following code in Custom Server Side Validation in my form on submit it will always store the data in Table, when the name or email is equal to one in the table, too.
<?php
$db =& JFactory::getDBO();
$name = JRequest::getString('name', '', 'post');
$email = JRequest::getString('email', '', 'post');
$query = "
SELECT COUNT(*)
FROM `#__chronoforms_data_Prinzentipp`
WHERE (`name` = '$name' OR `email` = '$email');
";
$db->setQuery($query);
$count = $db->loadResult();
if ( $count ) {
return "name or email does already exist ! Please try another !";
}
?>
Have anyone a suggestion for this problem.
Thanks a lot,
Jupp