2
I got a nicely formatted (rows and columns) set of checkboxes like this but now how do I read them after posting the form?
PHP:
$sql = 'SELECT name FROM '.$xoopsDB->prefix('gis_checkbox').'';
$result = $xoopsDB->query($sql);
list($opt) = $xoopsDB->fetchRow($result);
$testform = new XoopsThemeForm("", "testform", "setlayers.php");
while (list($name) = $xoopsDB->fetchRow($result)) {
$tray = new XoopsFormElementTray("");
$check = new XoopsFormCheckBox("",$name,0);
$check->addOption("0",$name);
$tray->addElement($check);
$testform->addElement($tray);
}
$testform->assign($xoopsTpl);
$xoopsTpl->display('db:'.$xoopsOption['template_main']);
Template:
<{$testform.javascript}>
<{$testform.title}>