i want to set different error message for each field in the form.This is my controller..
$this->form_validation->set_rules('fname', 'First Name','required');
$this->form_validation->set_message('required', 'कृपया प्रथम नाव भरा','fname');
$this->form_validation->set_rules('address', 'Address','required');
$this->form_validation->set_message('required', 'कृपया पत्ता भरा','address');
but problem is that if validation fails it print only error message for last field.
I solved it ...first of all autoload form helper and thern in view file
<?php if (form_error('gender'))
{
echo "कृपया लिंग निवडा";
}
;?>
where 'gender' is my field name.And I do it for each field in my form.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With