unclecheese / silverstripe-display-logic

The Display Logic module allows you to add conditions for displaying or hiding certain form fields based on client-side behavior.
BSD 3-Clause "New" or "Revised" License
74 stars 71 forks source link

Issue with multi-fields with `<input name="Field[]" />` #108

Open tractorcow opened 4 years ago

tractorcow commented 4 years ago

This isn't a common use case, but I've had to implement displaylogic support for a module with multiple repeated fields.

A form contains multiple groups of fields with <fieldlist class="displaylogic-holder">. Additional fields are added via clientside using javascript (fieldlist is cloned).

Proof of concept is up and working at https://github.com/isobar-nz/silverstripe-display-logic/commits/fix-rebuild, although I'm not sure this should be merged upstream.

tractorcow commented 4 years ago

I've also fixed an issue with IE11. It was erroring on the Object.entries() when looping.

michalkleiner commented 1 year ago

I'd be happy to look at a PR that adds support for array-style field names (FieldName[]), if we could also add some tests for that.