© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
Jon Mason

mask removed on form submit

The mask is removed after the form is submitted. How can I ensure it's persisted?

  TextInput::make('ein')->label('EIN')
                                    ->required()
                                    ->rules('max:10,min:10')
                                    ->mask('99-9999999')
                                    ->formatStateUsing(function (string $state) {
                                        if (strlen($state) === 9 && ctype_digit($state)) {
                                            // Insert a hyphen after the second digit
                                            return substr_replace($state, '-', 2, 0);
                                        }
                                        return $state;
                                    })
  TextInput::make('ein')->label('EIN')
                                    ->required()
                                    ->rules('max:10,min:10')
                                    ->mask('99-9999999')
                                    ->formatStateUsing(function (string $state) {
                                        if (strlen($state) === 9 && ctype_digit($state)) {
                                            // Insert a hyphen after the second digit
                                            return substr_replace($state, '-', 2, 0);
                                        }
                                        return $state;
                                    })
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

mask with afterStateUpdated immediately submits form
FilamentFFilament / ❓┊help
2y ago
validation.in on form submit
FilamentFFilament / ❓┊help
6mo ago
collapse form section on submit
FilamentFFilament / ❓┊help
2y ago
disable submit button on form
FilamentFFilament / ❓┊help
3y ago