Programmer man
Programmer man

Reputation: 393

Zend form- element error addmultioption

I have been working on zend for a while now, but have come across this error " Fatal error: Call to a member function addMultiOption() on a non-object " a number of times but was easily solved by changing the element but now can't see to find a solution, and below the form the is the same code which works fine don't know whats up here. here's the code the error comes from

$first_name->addMultiOption($staff->staff_id, $staff->first_name);

Upvotes: 0

Views: 84

Answers (1)

Programmer man
Programmer man

Reputation: 393

Change the first_name to match the element name

$organiser= new Zend_Form_Element_Select('organiser');
$organiser->addMultiOption($staff->staff_id, $staff->first_name);

Upvotes: 1

Related Questions