Welcome Guest, Not a member yet? Register   Sign In
Form validation callables combined with "required"
#15

(02-09-2016, 10:16 PM)Narf Wrote:
(02-09-2016, 03:59 PM)RobertSF Wrote: I had not expected the absence of "required" to end validation and call it successful. After all, in addition to mwhitney's scenario, there might be a field that is not required, but if supplied, must be numeric.

Validation succeeds only if the field is empty, it doesn't blindly trust fields without the "required" rule.

A "required_if" rule might be useful for mwhitney's scenario. I could use one right now as I'm having trouble associating a rule name with a callable rule.

If a rule name is supplied (per the third example in "Use anything as a rule") and the field is blank the validation does not run. If I don't supply the rule name it runs but the error message is not found and it returns "Unable to access an error message corresponding to blah, blah, blah..."
Reply


Messages In This Thread
RE: Form validation callables combined with "required" - by dave friend - 05-12-2016, 12:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB