PDA

View Full Version : Simple Checkboxes



ProfMarks
January 11th, 2009, 03:38
I might be missing an easy answer in the documentation, but I have been unable to find what I'm looking for.

I would like to have simple checkbox that can remember if it is in the true or false state. Am I correct in thinking check boxes are widgets and as such require script coding to use them? Alternatively, are they controls that can be linked to a particular field in the database.

If it is the former, is there a generic (read simple) script that is out there to create such a control that one wouldn't mind sharing.

Thanks!

Foen
January 11th, 2009, 07:03
In the default ruleset, checkboxes have been implemented as a template control (called 'checkbox') which can be used just how you describe. The FG engine doesn't support true/false values in the database, so it is implemented using a number database node, with 0=false and 'anything else'=true.

If you copy across the checkbox template (the template xml is in common_templates.xml and the script is in template_checkbox.lua) to your own ruleset, you should be able to use checkboxes without much scripting.

Hope that helps

Foen