Maybe I am doing something silly?
If I check a checkbox I see the data value 1 returned by the form. If I uncheck the checkbox no field value is returned. I would expect a value of 0 to be returned.
This is an issue since I have added some fields to the forum_edit template (a few are checkboxes) for a related entity. After saving a record I can not clear any checkbox field that was once checked.
The set of new fields are grouped into the same array to allow my saveTypeData code to not have to know about the individual fields. A checked checkbox gives a field value of 1 which gets coppied to the entity by a call to setupEntityInput (which really just does a bulkset). An unchecked checkbox is not present in the array of fields and hence the value of that field in the existing entity is never changed from set to unset.
Searching the forum I found 1 vague hint that this is working as designed: unset checkboxes are not returned by the form. But there was no info on how to remedy / handle this. The normal form / entity system obviously handles this since I can uncheck other check boxes and the underlying field gets unset. Is there some catchall logic somewhere that provides 0 values for missing fields?
I also have not been able to locate any documentation about form tags like checkbox and checkbox row.
Cheers...
If I check a checkbox I see the data value 1 returned by the form. If I uncheck the checkbox no field value is returned. I would expect a value of 0 to be returned.
This is an issue since I have added some fields to the forum_edit template (a few are checkboxes) for a related entity. After saving a record I can not clear any checkbox field that was once checked.
The set of new fields are grouped into the same array to allow my saveTypeData code to not have to know about the individual fields. A checked checkbox gives a field value of 1 which gets coppied to the entity by a call to setupEntityInput (which really just does a bulkset). An unchecked checkbox is not present in the array of fields and hence the value of that field in the existing entity is never changed from set to unset.
Searching the forum I found 1 vague hint that this is working as designed: unset checkboxes are not returned by the form. But there was no info on how to remedy / handle this. The normal form / entity system obviously handles this since I can uncheck other check boxes and the underlying field gets unset. Is there some catchall logic somewhere that provides 0 values for missing fields?
I also have not been able to locate any documentation about form tags like checkbox and checkbox row.
Cheers...