Hi, I can see that I can disable it, but how can you change only the error message of the autoregistered inArray validator in the config file?
Thx. SWK Matthew Weier O'Phinney-3 wrote: > > -- Arthur M. Kang <[email protected]> wrote > (on Thursday, 04 September 2008, 09:37 AM -0700): >> After upgrading to ZF 1.6, some of my Form->Select elements started >> having >> validation errors of 'value was not found in the haystack'. >> >> Firstly, I have not added any validators to these elements, so I don't >> know if >> it is a new feature of the framework to automatically add the InArray >> validator >> to certain elements. > > Yes, this is a new feature -- auto-registration of an InArray validator > that uses the keys of the multiOptions registered with the element. > > You can disable this with one of the following: > > // using the element instance: > $element->setRegisterInArrayValidator(false); > > // or a configuration key: > 'registerInArrayValidator' => false > element.options.registerInArrayValidator = false > >> Secondly, and more importantly, the select element is using a >> multi-dimensional >> which automatically creates OPTGROUP tags as headers within the >> selection. It >> looks like InArray is only checking against the first level of the array >> and >> does not check recursively. Since these OPTGROUP values are not >> selectable, >> the element will always fail validation. > > Right. This is a much more difficult validation to achieve, and we can > hopefully address it for a coming release. In the meantime, simply don't > register the validator, using the instructions above. > > -- > Matthew Weier O'Phinney > Software Architect | [email protected] > Zend Framework | http://framework.zend.com/ > > -- View this message in context: http://www.nabble.com/Problem-with-Form-Select-and-InArray-Validator-tp19314666p25788463.html Sent from the Zend Framework mailing list archive at Nabble.com.
