I was creating a TV with input type "Check Box", for "Input Option Values" I insert ’yes’, and for the "Default Value" also ’yes’. When editing a document with that TV, the check box appears as checked, but when I uncheck it, it’s not stored.
Am I doing something wrong here?
I tested with input type "Radio Options" and ’yes||no’ as input option values, which works fine.
René
Quote from: nightsignals at Oct 01, 2007, 03:29 PM
...but when I uncheck it, it’s not stored.
Not sure what you mean here. You uncheck the checkbox and no value is stored for the TV? If so, that’s how it’s supposed to work...
Or do you mean that you uncheck it but when you edit the document after saving it’s checked again?
Okay - I did some more testing. When not assigning a default value, it works. So I can rephrase my question: how can I use a TV with checkbox in a way it’s checked on default?
René
You’re right. I usually use radio buttons for Yes/No choices, so I hadn’t noticed this before. But I just created a checkbox like the one you describe and it does indeed ignore me when I uncheck it.
I’ve opened a bug report for this on FlySpray:
http://modxcms.com/bugs/task/957
I imagine that this is just the default value logic behaving in a counterintuitive way (the default value is entered automatically when the value is set to blank, so the checkbox reverts to "yes" after you uncheck it). Definitely something to take into account for the new core, but I’m not sure it will get fixed in 0.9.6 since I expect it would require a fairly comprehensive rewrite of that logic. For now, I recommend that you use Yes/No radio buttons instead (or I suppose that you could reverse your choices, i.e. unchecked is default and checked is to not do whatever it is you’re doing).
okay - thanks zap for confirming it as a bug. I go back to use the radio buttons then.
René
Looks like a different issue to me, since multi-selects and multiple checkboxes have worked properly since 0.9.5 I think.
I confirm I have the same issue. It drove me crazy for a while and I just worked around it by changing my method and used something else. I thought I was doing something wrong.