Gossamer Forum
Home : Products : DBMan : Customization :

Pretty check boxes with DbMan

Quote Reply
Pretty check boxes with DbMan
I have a field that uses many check boxes and it looks bad when it displays because some boxes do not fall in line with its text.
Is there a way to control the formatting of this?
Like inserting <BR> tags every 3 check boxes.

Thanks.
Quote Reply
Re: Pretty check boxes with DbMan In reply to
I'm not exactly sure what you want to do. If you could give more of an explanation, I might be able to help.


------------------
JPD





Quote Reply
Re: Pretty check boxes with DbMan In reply to
This happens in the add and modify screens. I have the fields inside a <TD> in a <TABLE>.
Since the checkboxes are so many and long they wrap around and sometimes the check box and its text do not fall in the same line which makes it look awkward and prone to mistakes since you could easily mark the wrong box.
I just want to be able to format this in, say, groups of 3 per row or something like that.

------------------
Quote Reply
Re: Pretty check boxes with DbMan In reply to
Okay. How about

Code:
<td>|;
print &build_checkbox_field("FieldName1","$rec{'Fieldname1'}");
print &build_checkbox_field("FieldName2","$rec{'Fieldname2'}");
print &build_checkbox_field("FieldName3","$rec{'Fieldname3'}");
print "<BR>";
print &build_checkbox_field("FieldName4","$rec{'Fieldname4'}");
print &build_checkbox_field("FieldName5","$rec{'Fieldname5'}");
print &build_checkbox_field("FieldName6","$rec{'Fieldname6'}");
print "</TD>";

Is this what you have in mind?

------------------
JPD





Quote Reply
Re: Pretty check boxes with DbMan In reply to
No
Here's my check box and is probably going to get longer:
%db_checkbox_fields = ( type => 'Trader,Roaster,Importer,Wholesaler,Distributor,Processor,Institution,Machine Manufacturer,Producer,Agent,Dist. Gourmet,Other ' );
They wrap around in the table cell I have placed this field.
I want to be able to display them like this when I add or modify records:
X Trader X Roaster X Importer
X xxxxxx X xxxxxxx X xxxxxxxx

The X are for the boxes and the xxxxx are for other names.
I hope you get it now.
Quote Reply
Re: Pretty check boxes with DbMan In reply to
You can't use checkbox fields like that, at least not in DBMan. You can't have more than one option in a checkbox field. It's more like an on/off switch.

What you could do is set up a checkbox field for each type.

Code:
%db_checkbox_fields = (
Trader => 'Trader',
Roaster => 'Roaster',
Importer => 'Importer',
Wholesaler => 'Wholesaler',
Distributor => 'Distributor',
Processor => 'Processor',
Institution => 'Institution',
Machine_Manufacturer => 'Machine Manufacturer',
Producer => 'Producer',
Agent => 'Agent',
Gourmet => 'Dist. Gourmet',
Other => 'Other'
);

Of course, you'll have to have matching fields in your db_def section of your .cfg file, too.

You could possibly have a radio field, but I usually don't use them if there are more than 4 or 5 options. Or you could use a select field.


------------------
JPD