© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
vahnmarty

How to make TextInput to allow only numbers without using numeric()

Currently when using TextInput::numeric(), the input gonna be
type="number"
type="number"


TextInput::make('zipcode__c')
    ->label('ZIP Code ')
    ->minLength(4)
    ->maxLength(10)
    ->numeric()
TextInput::make('zipcode__c')
    ->label('ZIP Code ')
    ->minLength(4)
    ->maxLength(10)
    ->numeric()


By using
numeric
numeric
the minLength and maxLength no longer works. And it also allows decimal values.
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

How to enter only letters and numbers in TextInput?
FilamentFFilament / ❓┊help
2y ago
How to block using of decimal numbers in TextInput
FilamentFFilament / ❓┊help
4mo ago
TextInput numeric with step
FilamentFFilament / ❓┊help
3y ago
Type of TextInput numeric()
FilamentFFilament / ❓┊help
3y ago