17488 Posts in 4473 Topics by 1978 members
|Go to End|
12 October 2008 at 9:27am Last edited: 13 October 2008 8:59am
I was wondering how I can specify more than one validator for a form?
Suppose I want to have RequiredFields, plus another validator of my own, how can I add this to a form?
As far as I can see, you can only pass one validator to the Form constructor, right? It won't accept an array of Validator objects I suppose... thus making this impossible?
Also, I was wondering what the point is of returning 'true' or 'false' in the php() method of Validator/RequiredFields? - it seems to me the only thing having a result is throwing a validationError() ?
And thirdly - is it possible to add a field to a form after the form has been created? - as on validation? (so when the failed form is returned?) In other words, change the form/add a field from within the validator? I don't think so but I might be wrong... I think I'll need to change/decorate the 'beforeProcessing' of Form somehow, or have a RedirectBack that lets me add a field.
13 October 2008 at 9:55am
Nevermind, think I've found it... more or less.
|Go to Top|