CodeIgniter Forums
Form_validation error messages {value}? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: Form_validation error messages {value}? (/thread-62958.html)



Form_validation error messages {value}? - Camo - 09-11-2015

Hello,
Is it possible to use something like {value} in form_validation error messages?
Like {field} and {param} in the next message:
PHP Code:
$lang['form_validation_exact_length']    = 'The {field} field must be exactly {param} characters in length.'



RE: Form_validation error messages {value}? - freddy - 09-12-2015

i think it can be handle by using call back seems like prevent same value inserted twice


RE: Form_validation error messages {value}? - Camo - 09-12-2015

Yes callback takes value as parameter. Thanks. But is there an universal solution for all rules in lang file?


RE: Form_validation error messages {value}? - mwhitney - 09-14-2015

No, since form_validation messages are usually displayed on the same form as the original values, and may be used in some cases to determine whether the values are safe, there is not currently (and there probably are no plans to add) a method of automatically including the value in the message.