Anyone have a good practice for creating a form field that is enabled based upon an entered value in another field on the same form? For example, imagine having two fields that are both optional. Lets call them penalty_message and penalty_points. If the user enters a value in penalty_message we would want to reveal the penalty_points field to accept a now required integer value. Otherwise the penalty_points field would be hidden (or disabled).
( This is a simple contrived example. )
Of course one can show both fields as optional and handle problems in _save validation logic but that is not ideal. Much better to prevent the user from entering a value in (or even see) the penalty_points field unless it makes sense to use the field.
--
TiG
updated by @tig: 09/13/18 06:35:11PM