Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Fields, that are only shown depending on other fields, cannot be set as being required (because they are not always visible to the user). Still it is useful to be able to make dependent fields required when their dependencies are met.
Comments
Comment #1
traxer CreditAttribution: traxer commentedI just noticed that this feature is already implemented.
Comment #2
3duardo CreditAttribution: 3duardo commentedhey traxer,
What is the feature called?
I am trying to figure this out so if user uploads image 'image upload field' to blog then the 'image description field' is required.
Thanks
Comment #3
traxer CreditAttribution: traxer commentedIt should suffice to mark the image description field as required and dependent upon the image upload field. This removes the required property from image description field and adds additional validation in case the image upload field was filled in.
This might not work with all field types, especially not with field types from other modules. File upload fields are also notoriously hard to handle.