Several ways depending on what you want to achieve.
One way is to use the Conditional formatting but this has the disadvantage of still allowing people to click in it.
Another way is to use script triggers. On layout entry have the script test for the value and go to layout. It means two layouts but it is quick enough not to be an issue and can be achieved by a single script.
There are probably other ways as well but those are the two I most often use.
Another method is the so-called "hidden portal" trick. In this method, you use a self-joining relationship that keys on a field set to the condition you want to set and a constant. For example, you set up a constant calculation that always evaluates to "1" and another field that toggles to "1" or empty based on your user's selection. Then set your relationship based on:
toggleField --- 1
plus the record key of the record in question. (In other words, you use both the toggle field and the record key as join criteria - a multi-predicate join.)
You then create a single-row portal, no lines, no scroll bar, one pixel larger than the field you want to hide. It's based on the self-join. When the join is true, the field appears. When it's not, there's no related record, so there's nothing to click on. It literally disappears.
Advantages: No second layout to maintain. No possibility of the user clicking in the field when you don't want him to.
Disadvantages: Extra occurrences on your Relationships Graph. More complicated to set up.
Thanks for the info, looks like I have a bit of work ahead of me.
Somewhat easier would be to make a self-join relationship based on the primary key (so there is always a valid relationship) and then use a portal filter to handle the toggle.
Ah, yes. Nice update to the technique.
I use buttons with Images. Set the transparency to 0. I don't set the button to have a hand cursor and exit the script so nothing happens. Works well.