Moh*_*ibi 4 forms validation zend-framework2
我在我的表格中使用这个:
$this->add(array(     
    'type' => 'Zend\Form\Element\Select',       
    'name' => 'county',
    'registerInArrayValidator' => false,
    'attributes' =>  array(
        'id' => 'county',                
        'options' => array(
            //'null'=>'[Select county]',
        ),
    ),
    'options' => array(
        'label' => 'county',
    ),
));
并使用js设置值县字段.验证后,我收到错误:haystack选项是必需的
小智 9
将disable_inarray_validator添加到选项:
$this->add(array(
    ...
    'options' => array(
        'disable_inarray_validator' => true,
        'label' => 'county',
    ),
));
| 归档时间: | 
 | 
| 查看次数: | 6080 次 | 
| 最近记录: |