© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
62 replies
Gandalf

Calculated input field in a form

I wish to include a calculated input field in a form, which is sum of a number of fields, some of which are dynamically included based on an attribute of the record. Although, I would calculate the value in the backend, I want to have the calculated value shown in the form itself while creation.

I've tried
evaluate()
evaluate()
method as well as
state()
state()
method both of which give
Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization
Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization


Is there a way to include such calculated fields?
Alternatively, how I can I include custom javascript only for the form of a particular resource? As then I can calculate the field value via javascript.
Solution
have you tried a Placeholder with content(function () {}) ?
Jump to solution
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

Render custom calculated field in a form
FilamentFFilament / ❓┊help
3y ago
Autocomplete Input Form Field
FilamentFFilament / ❓┊help
10mo ago
Calculated fields in form builder
FilamentFFilament / ❓┊help
3y ago
Summarize Sum of a calculated field
FilamentFFilament / ❓┊help
2y ago
Next page