我有两个用于选择部门和名称的下拉列表。
$model = new Application_Model_DbTable_Department();
$departments = $model->fetchAll();
$department = $this->createElement('select','department');
$department->setLabel('Department');
$department->setAttrib('class', 'department');
foreach($departments as $d)
$department->addMultiOption($d->id, $d->depname);
$model = new Application_Model_DbTable_Designation();
$designations = $model->fetchAll('depid=1');
$designation = $this->createElement('select','designation');
$designation->setLabel('Designation');
$designation->setAttrib('class', 'designation');
$designation->setRegisterInArrayValidator(false);
foreach($designations as $ds)
$designation->addMultiOption($ds->id, $ds->designation);
我有 jquery 功能,用于在更改部门时进行指定查找。我的问题是提交表单时,如果表单有验证错误,我需要显示选定的名称。