Issue Type: Bug Created: 2008-05-18T18:36:07.000+0000 Last Updated: 2008-09-02T10:39:41.000+0000 Status: Resolved Fix version(s): - 1.6.0 (02/Sep/08)
Reporter: Martin Mayer (martin.mayer) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Form
Related issues: - ZF-3563
Actualy I'm not sure if this is bug or feature, but I'd expect all elements extending Zend_Form_Element_Multi to work as enums.
Having this element:
<pre class="highlight"> $element = new Zend_Form_Element_Select('name'); $element->addMultiOption('foo', "FOO"); $element->addMultiOption('bar', "BAR");
<pre class="highlight"> $element->isValid('foo'); // returns true $element->getValue(); // returns "foo"
But I was a bit surprised that a value which is unlisted can be accepted and returned:
<pre class="highlight"> $element->isValid('unlisted-value'); // returns true $element->getValue(); // returns "unlisted-value"
I know this can be solved by adding InArray validator. But I would expect it's (probably the main) purpose and default behaviour of these elements not to let through unavailable options. If this behaviour is realy so intended, I think there should be at least warning in manual that it's upon to developer to provide the check manually. This relates to Select, MultiSelect, MultiCheckbox and Radio elements.
Posted by Wil Sinclair (wil) on 2008-06-01T15:43:29.000+0000
Please evaluate and categorize as necessary.
Posted by Matthew Weier O'Phinney (matthew) on 2008-08-04T13:26:23.000+0000
Behavior added to trunk and 1.6 release branch. New flag, 'registerInArrayValidator' allows you to disable the functionality as desired.
Also did the same for the Dojo form elements.
Posted by Wil Sinclair (wil) on 2008-09-02T10:39:41.000+0000
Updating for the 1.6.0 release.
Have you found an issue?
See the Overview section for more details.