We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32822
    • 18 Posts
    Hi,

    I’m trying to use a checkbox as a tv but when I try to read the value, I get no value? I have changed this to text now and manually write in in 1 or 0, but really, for the end user, I’d like it to be a checkbox. Am I doing something wrong here (have tried all output formats for the tv, no avail)

    Code for reading out the var:
    $aVars = $modx->getTemplateVarOutput(array(’tvCheckbox’));
    echo ’tvCheckbox’ . $aVars[’tvCheckbox’];

    or is this a bug?

    Thanks
      • 32822
      • 18 Posts
      Having read there were bugfixes for checkbox tvs in 2.03 just upgraded but still having the same problem. In fact, the value of the tv doesn’t seem to get saved at all? Here is what I have
      - set up a tvcheckbox, output value default, set access to the template
      - in the resource, the checkbox is checked by default, even though I want it not to be checked
      - if I uncheck it, save the page, it says saved all OK and checkbox is unchecked
      - however, when I go to another resource and then go back to the resource, the checkbox is still checked
      - value still can’t be retrieved as before

      Am I doing anything wrong or is this a bug - anyone?