© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
10 replies
pinoooh

default value when hidden()

I created a field that is only visible when a toggle is set (using
visible()
visible()
). This works fine, but when I update the field value AND toggle the field mentioned, the value of this field is not saved. I understand why this is the case: the field is not included in the post-data because it's not visible.
Is there a way to set a "default"-value when the field is not visible?
dehydrateStateUsing()
dehydrateStateUsing()
does not seem to work (even with
dehydratedWhenHidden()
dehydratedWhenHidden()
?

I know I could use the lifecycle-hooks, or even model-events but I want to include it in the form (to keep it all together). Any ideas?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Setting a default value for hidden fields
FilamentFFilament / ❓┊help
3y ago
Remove value when form field is hidden
FilamentFFilament / ❓┊help
3y ago
How can I set the default value of a Select, when its hidden?
FilamentFFilament / ❓┊help
3y ago
MorphToSelect default value value
FilamentFFilament / ❓┊help
6mo ago