Gossamer Forum
Home : Products : DBMan : Customization :

Splitting checkboxes

Quote Reply
Splitting checkboxes
Hi,

I am trying to do the following. I want the checkboxes to diplay in 3 columns. So I am trying JPDeni display multiple columns MOD with this. It's not working, please point me in the right direction to what needs to be done for this to work.


%build_select_fields = (

maritalstatus => 'Never Married,Divorced,Widowed,Separated',
children => 'No Children,1,2,3,4,5',
body => 'Small Frame,Thin,Toned,Proportional,Average wight,Broad Build,Portly'
);


$i = 1;
$cols = 3; # Change this to the number of columns you want
print "<table>";
for (0 .. $numhits - 1) {
unless ($_%$cols) {
print "<tr>";
}
print &build_select_field ("body", "$fields[$db{'body'}]");
if ($_%$cols==($cols-1)) {
print "</tr>\n";
}
++$i;
}
if ($numhits%$cols) {
for ($j=($cols-1);$j>=$numhits%$cols ;$j--) {
print "<td> </td>";
}
print "</tr>\n";
}

print "</table>";


Thanks