Golems GABB: Hiding Form Fields in Drupal 8
Imagine that you have created a content type with several fields. Depending on your needs, you may not require all of these fields to be displayed when viewing the entire node. Luckily, there is a simple way on Drupal how to hide a field on a form.
Code snippets may be applied to conditionally hide or enable a form field programmatically When you need to hide or show a form field. based on the specific value from another field, the Drupal form API hide field allows Drupal 8 hide form fields relating to values chosen in other fields.