aerni / statamic-livewire-forms

Supercharge your Statamic forms with Livewire
https://statamic.com/addons/aerni/livewire-forms
Other
28 stars 2 forks source link

Don’t submit values of hidden fields #30

Closed aerni closed 1 year ago

aerni commented 1 year ago

This PR introduces the same field data flow that Statamic uses for conditional fields. Conditionally hidden fields won't be added to the form submission anymore. If you want to submit the value of a hidden field, you can add always_save: true to the field in question.

This change is useful to keep your submission data clean of any values that should have not been submitted. A user might have activated a checkbox to show a field. Filled in that field, but then decided to deactivate the checkbox again. Without this PR, you woule still get the value of the filled in field, which should now have been removed.

This behavior is technically a breaking change, as some users might rely on all values to be submitted.