I have the good field content with the echo
$element_tray = new XoopsFormElementTray('Options');
$reqoption = "select title from ".$xoopsDB->prefix("ann_options")." where pid=$fam_annonce order by title";
$result5 = $xoopsDB->query($reqoption);
while ($result_array = $xoopsDB->fetchArray($result5))
{
echo $result_array['title']." -- ";
$ener = new XoopsFormCheckBox ($result_array['title'], 'checkbox[]');
$ener->addOption(1, _YES);
$element_tray->addElement($ener);
}
$form->addElement($element_tray);
$form->display();
echo $result_array['title']." -- ";
$reqoption = "select title from ".$xoopsDB->prefix("ann_options")."where pid=$fam_annonce order by title";
$result5 = $xoopsDB->query($reqoption);
while ($result_array = $xoopsDB->fetchArray($result5))
{
$ener = new XoopsFormCheckBox (_CLA_OPTION, 'checkbox[]', 1);
$ener->addOption($result_array['title']);
$form->addElement($ener);
}
$form->display();
....
while(list($title) = $xoopsDB->fetchRow($result5))
{
$option = "option".$xm;
echo "<input name='$option' type ='checkbox' value="$title">$title ";
$xm++;
}
$reqoption = "select title from ".$xoopsDB->prefix("ann_options")." where pid=$fam_annonce order by title";
$result5 = $xoopsDB->query($reqoption);
while ($result_array = $xoopsDB->fetchArray($result5))
{
$ener = new XoopsFormCheckBox (_CLA_OPTION,$result_array[],$result_array[]);
$ener->addOptionArray($result_array);
}
echo $result_array['title'];