Hi,

I am confused on how to populate the Select element from database. In
the Select element I need to fill it with location data which is
stored in database as single field table (each item is unique)

location
--------------
location1
location2
location3
...
... etc.
--------------

There is very little stated in the documentation about
"form->populate($data)" so I am confused on which goes where.

Can somebody illustrate its mechanics step by step conceptually? In
particular when I pass the "$data" variable how do I access that in
the form

1. defined as global variable for this form class? OR
2. directly use that variable when creating form element? something like

===========================================
$location = New Zend_Form_Element_Select('adlocation');
$location->setLabel('*Location:');
foreach($data as $loc)
{
    $adlocation->addMultiOption($loc, $loc);
}
===========================================

can somebody suggest me how to fill up this element?


Thanks


-- 
=======================
Registered Linux User #460714
Currently Using Fedora 8, 10
=======================

Reply via email to