-- Ahmed Abdel-Aliem <[EMAIL PROTECTED]> wrote
(on Sunday, 29 June 2008, 02:26 PM +0300):
> i am making a form that the elements in it changes dynamically, so i am adding
> the addEelement part in a loop
> 
> it looks like this :
> 
> $this->addElements(array($child_gender.'##'.$k, $birthdate_day.'##'.$k,
> $birthdate_month.'##'.$k, $birthdate_year.'##'.$k));
>            
> where $k is the number of the loop.
> 
> when i do this, i get the following error :

addElements() expects an array of elements -- each of which should
either be element instances or arrays with the information needed. Based
on what you describe, you most likely want this:

    $this->addElements(array(
        array($child_gender.'##'.$k), 
        array($birthdate_day.'##'.$k),
        array($birthdate_month.'##'.$k), 
        array($birthdate_year.'##'.$k),
    ));

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to