We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38193
    • 6 Posts
    I have a Listbox (Single-Select) TV that is configured to offer a list of resources using the getResources snippet:

    Input Option Values
    @EVAL return $modx->runSnippet('getResources', array('parents' => '0', 'context' => 'web', 'showHidden' => '1', 'limit' => '0', 'tpl' => 'getResourcesSelectListTpl', 'outputSeparator' => '||'));


    I also have Allow Blank set to Yes for this field, because I want the user to be able to leave this TV blank (and my template handles this correctly). I've also left the default value blank:

    Default Value


    The problem I'm having with this is that whenever I open a page with this TV for editing, the listbox loads up with the first resource selected, even if the current value of the TV is blank. As a result, if I want to edit this page and leave this TV blank, I must remember manually to click the listbox and hit Backspace to make the value blank again before I click Save.

    Is this a bug in the Listbox (Single-Select) input type, or am I doing something wrong?
      • 38193
      • 6 Posts
      I seem to have worked around this issue by typing a single space character in the Default Value for the TV.

      Before I report this as a bug, I'll wait a bit to see if anyone knows if this behaviour is intentional.
        • 4172
        • 5,888 Posts
        usually, you would add an empty option
        Please select==||
        before the other options
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!