Welcome Guest, Not a member yet? Register   Sign In
Validation errors per field AND per rule
#1

[eluser]sqwk[/eluser]
At the moment CI uses validation error messages per rule. There is already a library to convert them to be field-based (http://codeigniter.com/wiki/Custom_Valid...per_Field/), but is it possible to have them be field and rule based?

Something like this: (In external language file. Should also work with ->set_message())
Code:
$lang['id_in_db','places']    = "This place does not exist.";
$lang['id_in_db', 'objects']    = "This object does not exist.";
$lang['id_in_db']    = "This ID does not exist.";
Where places or objects are the name of the field that needs to be validated and id_in_db is the validation rule/function. If no field is set, it would default to the standard rule.




Theme © iAndrew 2016 - Forum software by © MyBB