- I added a boolean field named
Fee waivedto the user account.
- On the edit form, this field is represented as a single checkbox.
- Users cannot edit the value; only admins can see and edit it (I'm using
- When the checkbox is selected,
Fee waived: Yesappears in the user profile. I want this.
- When the checkbox is NOT selected,
Fee waived: Noappears in the user profile. I don't want this. I don't want anything to show (because I don't want users wondering how to get their fee waived).
By default, when a user account field is empty, nothing is displayed for it in the user profile. However, a non-checked checkbox is not empty; it has a value of 0 (or whatever has been defined for it). This is why I get
Fee waived: No in the user profile.
Is there a simple way to keep the field from being displayed in the user profile when it is not selected?
conditional_fieldsmodule would allow a field to be dependent upon itself, that would work beautifully to solve the problem. But it does not. I tried disabling the 'same field' check in the module's code. This works, in that the field is hidden exactly as I want it to be, but when the
I tried other modules that allow value-based field control (
field conditional stateand
field formatter settings), but none seem to allow a field to depend upon itself.
I placed a span tag with the class
This works, but when the profile is displayed, the user sees a "hiccup" as the to-be-hidden field is briefly shown and then hidden.