[pmwiki-users] Checkboxes for updating PTVs

kirpi at kirpi.it kirpi at kirpi.it
Sat Dec 20 04:11:12 CST 2014


I recently wanted to adopt some checkboxes in a form derived from Fox Contacts.
Such a form is used both for entering and updating data.
My idea was to have some switches, some easy to use Yes/No fields,
with an immediate "boolean" feeling of On/Off useable for setting and
updating PTVs.
Radio buttons were not interesting as I felt they were better suited
for "real" values (Male/Female) and also they are less compact.
Moreover, I had problems setting defaults values, whereas checkboxes
have a "natural" zero value as a start.
I tried but failed to have them working.
Thanks to Hans, I then learned that checkboxes only send a value if
checked, whereas they send just nothing when not checked. This way,
there is no way to update/zero an already set value just by unchecking
a checkbox.
After some attempts, we found that there is an easy and well-working hack
    (:input hidden $:abc 0:)
    (:input checkbox $:abc 1:)
It is perhaps well known, or perhaps not.

So, I just wanted to share it
:-)

Thanks!

Luigi



More information about the pmwiki-users mailing list