Disable Inarray Validator on Zend Form
<p>I have a form that was working until I added two dropdown menus.  Since then, upon the submission of the form I get the error: </p>

<blockquote>
  <p>haystack option is mandatory</p>
</blockquote>

<p>This is my ProjectForm.php </p>

<pre><code>&lt;?php

namespace Project\Form;
use Zend\Form\Form;
use Zend\Form\Element\Text;
use Zend\Form\Fieldset;
use Zend\Form\Element\Select;
use Zend\Form\Element\Checkbox;
use Zend\Form\Element\Date;
use Zend\Config\Factory;
use Zend\Form\Element\Button;
use Zend\Form\Element\Textarea;
use Zend\Validator\Callback;
use Zend\InputFilter\InputFilterProviderInterface;
use Zend\Form\Element\File;

class ProjectForm extends Form implements InputFilterProviderInterface {

    const KEY_PROJECT_NAME = "project_name";
    const KEY_PROJECT_DUE_DTTM = "project_due_dttm";
    const KEY_PROJECT_DESCRIPTION = "project_description";
    const KEY_PROJECT_CONFIG = "project_config";
    const KEY_PROJECT_TYPES = "project_types"; 
    const KEY_PROJECT_WORKFLOW_CONFIG = "project_workflow_config";
    const KEY_PROJECT_WORKFLOW_TYPES = "project_workflow_types";
    const KEY_PROJECT_FILE = "project_file";
    const KEY_SAVE_BTN = "project_save_btn";
    const KEY_CANCEL_BTN = "project_cancel_btn";


    public function __construct($name = null, $options = array()) {
        parent::__construct($name);

        $this-&gt;setAttribute('method', 'post');
        $this-&gt;setAttribute('class', 'form-horizontal');

        $name = new Text(self::KEY_PROJECT_NAME);
        $name-&gt;setAttribute("id", self::KEY_PROJECT_NAME);
        $name-&gt;setLabel("Name");

        $duedttm = new Text(self::KEY_PROJECT_DUE_DTTM);
        $duedttm-&gt;setAttribute("id", self::KEY_PROJECT_DUE_DTTM);
        $duedttm-&gt;setLabel("Due Date");

        $description = new Textarea(self::KEY_PROJECT_DESCRIPTION);
        $description-&gt;setAttribute("id", self::KEY_PROJECT_DESCRIPTION);
        $description-&gt;setLabel("Description");

        $config = new Textarea(self::KEY_PROJECT_CONFIG);
        $config-&gt;setAttribute("id", self::KEY_PROJECT_CONFIG);
        $config-&gt;setLabel("Configuration");

        $projectTypeDropDown = new Select(self::KEY_PROJECT_TYPES); 
        $projectTypeDropDown-&gt;setLabel('Project Type:'); 
        $projectTypeDropDown-&gt;setValueOptions($options["project"]); 

        $wfConfig = new Textarea(self::KEY_PROJECT_WORKFLOW_CONFIG);
        $wfConfig-&gt;setAttribute("id", self::KEY_PROJECT_WORKFLOW_CONFIG);
        $wfConfig-&gt;setLabel("Workflow Configuration");

        $projectWorkflowDropDown = new Select(self::KEY_PROJECT_WORKFLOW_TYPES);
        $projectWorkflowDropDown-&gt;setLabel('Workflow Type:');
        $projectWorkflowDropDown-&gt;setValueOptions(array());

        $file = new File(self::KEY_PROJECT_FILE);
        $file-&gt;setAttribute("id", self::KEY_PROJECT_FILE);
        $file-&gt;setAttribute("multiple", true);
        $file-&gt;setLabel("File");

        $save = new Button(self::KEY_SAVE_BTN);
        $save-&gt;setAttributes(array("id", self::KEY_SAVE_BTN));
        $save-&gt;setLabel("Save");
        $save-&gt;setValue("Save");

        $cancel = new Button(self::KEY_CANCEL_BTN);
        $cancel-&gt;setAttributes(array("id", self::KEY_CANCEL_BTN));
        $cancel-&gt;setLabel("Cancel");

        $this-&gt;add($name);
        $this-&gt;add($duedttm);
        $this-&gt;add($description);
        $this-&gt;add($config);
        $this-&gt;add($projectTypeDropDown); 
        $this-&gt;add($wfConfig);
        $this-&gt;add($projectWorkflowDropDown); 
        $this-&gt;add($file);
        $this-&gt;add($save);
        $this-&gt;add($cancel);
    }

    public function isValidJSON($value, $options) {
        try {
            JSON::decode($value);
            return true;
        } catch (JSONException $e) {
            return false;
        }
    }

    public function isValidDateTime($value, $options) {
        if (false === date_create($value)) {
            return false;
        }
        return true;
    }

    /**
     * (non-PHPdoc)
     * @see \Zend\InputFilter\InputFilterProviderInterface::getInputFilterSpecification()
     */
    public function getInputFilterSpecification() {
        return array(
                ProjectForm::KEY_PROJECT_CONFIG =&gt; array(
                        'required' =&gt; true,
                        'filters' =&gt; array(
                                array(
                                        'name' =&gt; 'Zend\Filter\StringTrim'
                                ),
                        ),
                        'validators' =&gt; array(
                                new Callback(
                                        array(
                                                $this,
                                                'isValidJSON'
                                        )),
                        ),
                ),
                ProjectForm::KEY_PROJECT_WORKFLOW_CONFIG =&gt; array(
                        'required' =&gt; false,
                        'filters' =&gt; array(
                                array(
                                        'name' =&gt; 'Zend\Filter\StringTrim'
                                ),
                        ),
                        'validators' =&gt; array(
                                new Callback(
                                        array(
                                                $this,
                                                'isValidJSON'
                                        )),
                        ),
                ),
                ProjectForm::KEY_PROJECT_DUE_DTTM =&gt; array(
                        'required' =&gt; false,
                        'filters' =&gt; array(
                                array(
                                        'name' =&gt; 'Zend\Filter\StringTrim'
                                ),
                        ),
                        'validators' =&gt; array(
                                new Callback(
                                        array(
                                                $this,
                                                'isValidDateTime'
                                        )),
                        ),
                ),

        );
    }
}
</code></pre>

<p>I think I need to disable the <code>inarray_validator</code> by adding <code>disable_inarray_validator' =&gt; true</code> but I'm not sure where to add this. </p>