We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    I’m confused by the checkbox TVs... how can I define a checkbox TV that is unchecked by default? It seems to make it UNCHECKED by default, I have to put ’0’ as the default value when I define the TV, but if I want to be CHECKED by default I have to leave the default value blank.

    Is that correct? Is there any way to change which values are stored for a single checkbox? Or is that what the "default value" actually stores?

    It seems that when I have a default value listed, I cannot UNCHECK the box. WTF? So confused right now...

    The database doesn’t even seem to be storing a value:
    mysql> select * from modx_site_tmplvar_contentvalues where tmplvarid=60;
    +-----+-----------+-----------+-------+
    | id  | tmplvarid | contentid | value |
    +-----+-----------+-----------+-------+
    | 159 |        60 |        37 |       |
    | 160 |        60 |        42 |       |
    +-----+-----------+-----------+-------+
      • 3749
      • 24,544 Posts
      I would assume that putting 1 as the default value would make it checked by default, but I haven’t tested it lately.

      If you’re just looking in the database it’s easy to get confused, because MODX doesn’t store anything at all when the TV value for a resource equals the default value of the TV.

      Try looking at the output of a TV tag in a resource to find out what MODX thinks the value is for that resource.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 9207 ☆ A M B ☆
        • 2,475 Posts
        Thanks Bob. Wow... that seems like a strange way of handling it, but I suppose it has to do with handling the cases where TVs are added to a template after multiple resource are already using the template.