Welcome Guest, Not a member yet? Register   Sign In
Validation, multiple instances of %s?
#5

[eluser]xwero[/eluser]
The sprintf is done near the end of the run method, in the Form_validation it's done in the _execute method but it's the same prucedure in both libraries. The first placeholder is for the field and the second for the rule parameter. The field and rule parameter are only known locally so you can't change them in a validation rule.

So if you want a message like "Attention the E-mail field must contain a valid email address." You need to set up your message like drewbee suggested "%2$s the %1$s field must contain a valid email address." and in the rules config do something like
Code:
$rules['email'] = 'valid_email[Attention]';


Messages In This Thread
Validation, multiple instances of %s? - by El Forum - 10-02-2008, 02:25 PM
Validation, multiple instances of %s? - by El Forum - 10-02-2008, 02:42 PM
Validation, multiple instances of %s? - by El Forum - 10-02-2008, 02:49 PM
Validation, multiple instances of %s? - by El Forum - 10-02-2008, 03:02 PM
Validation, multiple instances of %s? - by El Forum - 10-03-2008, 12:37 AM
Validation, multiple instances of %s? - by El Forum - 10-03-2008, 03:31 AM
Validation, multiple instances of %s? - by El Forum - 10-03-2008, 03:45 AM
Validation, multiple instances of %s? - by El Forum - 11-10-2008, 12:47 PM
Validation, multiple instances of %s? - by El Forum - 11-10-2008, 02:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB