ZF2: How do I use InArray validator to validate Multiselect form element?
I have a ZF2 form where I had to disable native validators, for a specific reason. Then, when adding elements programatically to the form I also add validators. One of the elements is a Multiselect array. $form->add( array( 'type' => 'Zend\Form\Element\Select', 'options' => array( ( 'label' => 'few items', 'value_options' => Array ( 'one' => 'one', 'two' => 'two', 'three' => 'three', 'four' => 'four', ) ), 'attributes' => array ( 'multiple' => 'multiple', 'value' => array('two','three'), 'required' => 1, 'id' => 'few_items' ), 'name' => 'few_items' )); Also, I'm going to add an InArray