zend framework2 - zf2 MultiCheckbox Error: The input was not found in the haystack -


i displaying dynamic checkbox using zend\form code:

$this->add(array(     'type' => 'zend\form\element\multicheckbox',            'name' => 'user_group_id',     'attributes' =>  array(         'id' => 'user_group_id',          'options' => $tagdata,     ), ));    

this works fine. when have encrypted values in $tagdata, form produces error:

the input not found in haystack

i have tried 'disable_inarray_validator' => false , 'inarrayvalidator' => false, none working.

they work select element. how accomplish same multicheckbox?

there 2 approaches here

1) disable validators on specific field(if zf2 allows disable validator). tho @ moment few validators after being disable remove/hide haystack error. still wont form validate.

2) may need re-populate values/reset values field after data posted.the thing zf2 form assumes values should in haystack. can

$form->get('user_group_id')->setattribute('option',$request->getpost('whateveryouaregettingfrompostforthischeckbox')); 

after dump form check box element , check if value or option or w/e want set there or not.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -