Gossamer Forum
Home : Products : DBMan : Customization :

Using Check Boxes - Help Needed

Quote Reply
Using Check Boxes - Help Needed
I am using a total of 47 check boxes in a database. These enable specific choices to be made by users. I need multiple choice fields, hence the use of check boxes.
I have placed the boxes in rows in html.pl.
I now confess to being unsure of how to set it all up.
I have used the following html syntax:

<td width="106" align="right" style="border-left: 1px solid; border-top: 1px solid; border-bottom: 1px none"
valign="middle" height="1"><font face="Arial" size="1">Private </font><input
type="checkbox" name="C1" value="$rec{'Private'}" tabindex="1"></td>
<td width="109" align="right" style="border-top: 1px solid; border-bottom: 1px none"
valign="middle" height="1"><font face="Arial" size="1">Corporate </font><input
type="checkbox" name="C2" value="$rec{'Corporate'}" tabindex="2"></td>
<td width="104" align="right" style="border-top: 1px solid; border-bottom: 1px none"
valign="middle" height="1"><font face="Arial" size="1">Institutional </font><input
type="checkbox" name="C3" value="$rec{'Institutional'}" tabindex="3"></td>

Is this correct?
When a checkbox is checked, on creating the record, what value would be ascribed? Would it be the literal alpha value given in the value="rec{'value'} variable? This would not matter since none of these variables will be printed, but simply used to return matching records in a search.
Do I have to make any changes in the db.cfg file?

If I can get this problem sorted, then I think I am finished on this project.

Just one more thing. Will Eli Finkelman's cookie mod work with the secure lookup mod?

Thanks



David Olley
Anglo & Foreign International Limited,
Winchester
England
Quote Reply
Re: Using Check Boxes - Help Needed In reply to
You should be using the db_checkbox_field option.

In default.cfg, theres a section where you define your checkboxes and their relevant values to retun when checked.

eg:
Code:
# Checkbox fields. Field name => Checkbox value.
Û_checkbox_fields = ( C1 => 'Yes',
C2 => 'Yes',
C3 => 'Yes',
);
Then in html_record_form, you use:

print qq|
<td width="106" align="right" style="border-left: 1px solid; border-top: 1px solid; border-bottom: 1px none"
valign="middle" height="1"><font face="Arial" size="1">Private </font>|; print &build_checkbox_field ("CS1", "$rec{'CS1'}"); print qq|</td>

This is how checkboxes were originally supposed to be set up with DBMan, if you've avoided this for some reason, some extra configuration will be required, otherwise, I suggest you check out JPDeni's DBMan-Ual for some tutorials in setting up DBMan: http://www.jpdeni.com/dbman/

- Mark

Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: Using Check Boxes - Help Needed In reply to
Yes, the cookie mod will work with the secure password lookup mod.


JPD
Quote Reply
Re: Using Check Boxes - Help Needed In reply to
Thanks for the reply Mark

I have now looked at JPDs Configurator, which, of course, I should have done first. I used standard html code, rather than DBMan syntax.
With any luck, a bit of rewriting this morning will have it working smoothly.

Regards

David Olley
Anglo & Foreign International Limited,
Winchester
England
Quote Reply
Re: Using Check Boxes - Help Needed In reply to
Thanks, Carol, for the reassuring news about the cookie mod!
I felt completely lost yesterday when, for some reason, access to the Gossamer BB was a little, er, sticky.
Possibly due to the wet string between UK and USA drying out. :-)

Cheers


David Olley
Anglo & Foreign International Limited,
Winchester
England