Zend: Form validation: value was not found in the haystack error

后端 未结 4 2043
情歌与酒
情歌与酒 2021-02-13 03:45

I have a form with 2 selects. Based on the value of the first select, it updates the values of the second select using AJAX. Doing this makes the form not being valid. So, I mad

4条回答
  •  忘掉有多难
    2021-02-13 04:14

    You could try to deactivate the validator:

    in your Form.php

    $field = $this->createElement('select', 'fieldname');
    $field->setLabel('Second SELECT');
    $field->setRegisterInArrayValidator(false);
    $this->addElement($field);
    

    The third line will deactivate the validator and it should work.

提交回复
热议问题