views:

6

answers:

1

Hi there, I am having an issue with Zend_Form and your help will be appreciated. in fact I have a class to generate categories as options

$categories = My_Util_Category::toHtmlSelect();//for simplicity I removed other lines

this code generates

<select> 
 <option > root</option> 
 <option> root / children</option> 
 </select>

On another hand, I use Zend_Form form to edit categories. The code looks like:

$form = My_Form_Category( $data, $selectElements = array() );

which outputs a form, text field, a select box for parent categories and a submit button.

How can I get 'select element' from $form, and replace it with row html 'select' generated with $categories

any help, or link will be appreciated. Thanks.

A: 

Well, I changed the drop down list, and instead of

$categories = My_Util_Category::toHtmlSelect();

I have

$categoryList = My_Util_Category::getCategoryList();

which returns an array and pass returned array to the form constructor as

$form = My_Form_Category( $data, $categoryList );

Hope that it will help some body else.

P.M