Default Value for List Checkboxes

5 posts by 4 authors in: Forums > CMS Builder
Last Post: March 6, 2013   (RSS)

By clowden - February 6, 2013

I have a list that I am creating through the "Get options from database" (screenshot attached).

I would like all of the options, 4 of them, to all be checked by default. If I just type in a record number it will select only that one, makes sense, but could notĀ figureĀ out how to select them all. I tried "1,2,3,4" and other combinations like that but nothing worked.

Hi Clowden,

I assume you mean when a record is created in the CMSB back end and not in a viewer.

I think you'll have to use get options from MySQL Query.

I'm not sure how to set up the code.

Sorry I can't be of more help.

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By clowden - February 6, 2013

Correct. I want all of my list options to be checked by default when myself or another users creates a new record.

Just wanted to attach that screen to show how the list was generated and the default options I was talking about.

Thank you.

By Codee - March 6, 2013

I don't know if it would work in this specific case (since I don't have all the details)...BUT...sometimes when I'm up against an issue like this I use 'reverse-programming-psychology'. So I would create a check field for when the element is NOT wanted, if that is the less-than-normal case. Then I add a where filter at the top of the page (if necessary) for the reverse statement instead. Basically, if every record is going to have those items by default, then make the checkbox be positive for 'not' having it by default. Sometimes it ends up easier, simpler, and cleaner code.