1
Well, I tried during week-end to fin a solution.
Actually, this is the only way that I find to specified wich option is use :
With this, all Checkbox are already checked in form and to not display one of this option in result I must uncheck that I don't want to display.
I've tried to change the number "1" by "0" in each $xxx->addOption("1","xxx"); . With this change all Chackbox are effectively uncheck but when I check one or more nothing is display in result.
The other prob (and whatever if in form the checkbox are check/uncheck by default) I can't change the status when I use the edition.
I've readed all posts (with search engine) about checkbox but I didn't find what's wrong with my php code.
Thank you for your help.
Actually, this is the only way that I find to specified wich option is use :
$equip_tray = new XoopsFormElementTray(_MD_CATADS_EQUIP);
$abs = new XoopsFormCheckBox("", "abs", !$abs[$i++]);
$abs->addOption("1","ABS");
$equip_tray->addElement($abs);
unset($abs);
$esp = new XoopsFormCheckBox("", "esp", !$esp[$i++]);
$esp->addOption("1","ESP");
$equip_tray->addElement($esp);
unset($esp);
$vitreselect = new XoopsFormCheckBox("", "vitreselect", !$vitreselect[$i++]);
$vitreselect->addOption("1","Vitr.Elec");
$equip_tray->addElement($vitreselect);
unset($vitreselect);
$verrcentral = new XoopsFormCheckBox("", "verrcentral", !$verrcentral[$i++]);
$verrcentral->addOption("1","Verr.Central");
$equip_tray->addElement($verrcentral);
unset($verrcentral);
$clim = new XoopsFormCheckBox("", "clim", !$clim[$i++]);
$clim->addOption("1","Climatisation");
$equip_tray->addElement($clim);
unset($clim);
$teleco = new XoopsFormCheckBox("", "teleco", !$teleco[$i++]);
$teleco->addOption("1","Teleco");
$equip_tray->addElement($teleco);
unset($teleco);
$mainlibre = new XoopsFormCheckBox("", "mainlibre", !$mainlibre[$i++]);
$mainlibre->addOption("1","Main.Libre");
$equip_tray->addElement($mainlibre);
unset($mainlibre);
$odb = new XoopsFormCheckBox("", "odb", !$odb[$i++]);
$odb->addOption("1","ODB");
$equip_tray->addElement($odb);
unset($odb);
$peintmetal = new XoopsFormCheckBox("", "peintmetal", !$peintmetal[$i++]);
$peintmetal->addOption("1","Peint.Metal");
$equip_tray->addElement($peintmetal);
unset($peintmetal);
$radiocd = new XoopsFormCheckBox("", "radiocd", !$radiocd[$i++]);
$radiocd->addOption("1","RadioCD");
$equip_tray->addElement($radiocd);
unset($radiocd);
$radiocass = new XoopsFormCheckBox("", "radiocass", !$radiocass[$i++]);
$radiocass->addOption("1","RadioCass");
$equip_tray->addElement($radiocass);
unset($radiocass);
$toit = new XoopsFormCheckBox("", "toit", !$toit[$i++]);
$toit->addOption("1","T.O");
$equip_tray->addElement($toit);
unset($toit);
$regvit = new XoopsFormCheckBox("", "regvit", !$regvit[$i++]);
$regvit->addOption("1","Reg.Vitesse");
$equip_tray->addElement($regvit);
unset($regvit);
$cuir = new XoopsFormCheckBox("", "cuir", !$cuir[$i++]);
$cuir->addOption("1","Cuir");
$equip_tray->addElement($cuir);
unset($cuir);
$jantalu = new XoopsFormCheckBox("", "jantalu", !$jantalu[$i++]);
$jantalu->addOption("1","Jante.Alu");
$equip_tray->addElement($jantalu);
unset($jantalu);
$boitoto = new XoopsFormCheckBox("", "boitoto", !$boitoto[$i++]);
$boitoto->addOption("1","Boite.Auto");
$equip_tray->addElement($boitoto);
unset($boitoto);
$gps = new XoopsFormCheckBox("","gps", !$gps[$i++]);
$gps->addOption("1","GPS");
$equip_tray->AddElement($gps);
unset($gps);
$adsform->addElement($equip_tray, false);
With this, all Checkbox are already checked in form and to not display one of this option in result I must uncheck that I don't want to display.
I've tried to change the number "1" by "0" in each $xxx->addOption("1","xxx"); . With this change all Chackbox are effectively uncheck but when I check one or more nothing is display in result.
The other prob (and whatever if in form the checkbox are check/uncheck by default) I can't change the status when I use the edition.
I've readed all posts (with search engine) about checkbox but I didn't find what's wrong with my php code.
Thank you for your help.