I have a callback function that check_captcha which sees if $row
is ==0
or == 1
(this information is queried from sql).
The p
That helped me
go to application/config/autoload.php and add "Security" helper class there.
$autoload['helper'] = array('security');
Or add this before your form validation
$this->load->helper('security');
You can set error message in set_rules
:
$this->form_validation->set_rules('captcha', 'Captcha', 'callback_check_captcha',
array('check_captcha' => 'text dont match captcha'));
Actually the best way, instead of write the error message directly on controller, would be add this entry "check_captcha" on languages.
In my case, the message for validation rule (form validation) "less_than" was not present.
I changed the file /system/language/??/form_validation_lang.php. I've added the missing entry.
$this->form_validation->set_message('check_captcha', 'text dont match captcha');
The message name corresponds to the function, not the field. So setting it to "check_captcha" will fix your bug. The error message will use the correct field name.
add a entry to your language file with named of the part inside the (yourfieldname) of the errormessage - thats solved the problem