hyrax icon indicating copy to clipboard operation
hyrax copied to clipboard

Support required fields that are either-or

Open tpendragon opened this issue 8 years ago • 4 comments

Plum's use case is they can enter EITHER a title or a source_metadata_identifier and it's a valid record, but the JS in required_fields.es6 makes this problematic. Best way to do this is probably to support attaching a data-attribute that groups fields' requirement states together.

tpendragon avatar Feb 08 '17 00:02 tpendragon

Can you use the same input element and a separate one to select which field it applies to? That way the same input element is required for both.

atz avatar Feb 08 '17 00:02 atz

No, because after the source_metadata_identifier is filled out it'll import a title after saving, which is useful to see. (The title field gets marked as readonly, in that case.)

tpendragon avatar Feb 08 '17 00:02 tpendragon

I was able to work around this like this: https://github.com/pulibrary/plum/commit/627424f76f07eac3503d954d9daf669c01785e17

But it'd make me a lot more comfortable to have built in functionality for this, just so we're not binding to things like when events happen or what attributes are looked at.

tpendragon avatar Feb 16 '17 20:02 tpendragon

Per SMIG, there is not interest in this right now.

acklose avatar Apr 22 '25 18:04 acklose