On Sat, Jan 31, 2009 at 10:48 PM, Daniel Latter <[email protected]> wrote:
> Are you sure your setting $this->data variable in the form class?, and
> if so var_dump it to see what it contains?
>

My sample trial code

in my controller
==================
$data = array('location1' => 'location1');
$form    = $this->_getTestForm();
$form->populate($data);
...
....
==================

in my form
===========================================
$location = New Zend_Form_Element_Select('location');
$location->setLabel('*Location:');
foreach($this->data as $loc)  //<<<<<<<<<
{
 $adlocation->addMultiOption($loc);
}
...
...
===========================================

Now I expect that the select element in the form be pouplated with a
value showing 'location1' but nothing gets in there instead error
message is shown at the bottom of the form [Invalid argument supplied
for foreach()]

I have another select element in the form, which is hand coded.
$myopts->setMultiOptions(array('option1' => 'option1', 'option2' => 'option2'));

This second select gets rendered correctly in the form.

so what's going on?

Thank a lot

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

Reply via email to