When you submit a form, disabled form fields are not sent to the request.
So, if your form has a disabled form field, it does the job a Zend_Form::isValid()little frustratingly.
$form->populate($originalData);
$form->my_text_field->disabled = 'disabled';
if (!$form->isValid($_POST)) {
$form->my_text_field->value($originalData['my_text_field']);
$this->view->form = $form;
return;
}
Without having to fill out the form again and create duplicate lines of code, what is the best way to approach this problem?
source
share