Click to See Complete Forum and Search --> : problem with checkbox group in QuickForm


jafeth
05-18-2006, 05:08 PM
Hi 4 all!

To someones who was creating form in QuickForm with groups of checkboxes...

I create a bigger form for my web users profiles using QuickForm. This form gets data from 3 tables: profile, intresting, searching. When user have data only in table profile everything is OK, but when form get data from all 3 tables to edit this data, then I have a problem. Quick Form throws sth like that:

Fatal error: Call to a member function getName() on a non-object in
D:\XAMP\xampp\php\pear\HTML\QuickForm\group.php on line 391

Fields intersting and searching in form are a group of checkbox. I create this group using:

foreach($intrestingAll as $key => $value)
{
$intresting[] = HTML_QuickForm::createElement('checkbox', $key,null, $value);
}

$form->addGroup($intresting, 'intresting',
'Intrested in:', ' ')


Searching fields in the same way.

I set the defaults data in the beginning:


if (isset($profil) || isset($interesting) || isset($searching))
{
$data = $profil + $interesting+ $searching;
$form->setDefaults($data);

}


If this data are set, the program fails, QuickForm throws exception as I wrote.

If anyone could help me... :)

Thanks a lot

PS: Sorry for my english :]