Re: Quickform group error

From: Date: Fri, 08 Dec 2006 12:53:05 +0000
Subject: Re: Quickform group error
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-26024@lists.php.net to get a copy of this message
Hi, rav k wrote:
This is what I'm doin to dynamically add the skills as checkboxes: /* ADD THE SKILLS */ $res =& $mdb2->query('SELECT * FROM Skills'); while ($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC)) {
    $skills[] = &HTML_QuickForm::createElement('advcheckbox', $row['skillid'], null,'<b>'.$row['skillname'].'</b>'.' : '.$row['description']);
} And I am adding them this way: $form->addGroup($skills, 'skills', 'Your skills:', '<br />'); The problem is I get the following error when attempting to validate: Fatal error: Call to a member function on a non-object in /home/user/public_html/iim/pear/PEAR/HTML/QuickForm/group.php on line 391 Can anyone please offer a solution to this??
Turn off register_globals and/or clear the $skills array before adding form elements to it.

« previous php.pear.general (#26024) next »