Hello,
I use the Mootools validation for my form, but some user has JS disabled. For this case I want add a server-side validation to my form.
But it doesn't work.
My form has fields like 'street', 'phone', 'city' a.s.o.
My server validate-script looks like this:
If I disable my JS and try to send the form, the follwing error is show'n:
Why this error comes and what can I do to fix this problem?
Regards,
Torty
I use the Mootools validation for my form, but some user has JS disabled. For this case I want add a server-side validation to my form.
But it doesn't work.
My form has fields like 'street', 'phone', 'city' a.s.o.
My server validate-script looks like this:
<?php
$errors = array();
if(empty(JRequest::getVar('phone', null))) {
$errors[] = 'error-msg for the field.';
}
if(empty(JRequest::getVar('street', null))) {
$errors[] = 'error-msg for the field.';
}
if(empty(JRequest::getVar('city', null))) {
$errors[] = 'error-msg for the field.';
}
if (sizeof($errors)) {
$errors = implode('<br />', $errors);
return $errors;
}
?>
If I disable my JS and try to send the form, the follwing error is show'n:
Fatal error: Can't use function return value in write context in D:\xampp\htdocs\vv2k9\components\com_chronocontact\libraries\chronoform.php(244) : eval()'d code on line 4
Why this error comes and what can I do to fix this problem?
Regards,
Torty