© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•11mo ago•
10 replies
Crispy

Way to only allow numeric in search dropdown for filament select element?

Hello!

I have this select for Zipcode that populates after the user types inside the
searchable()
searchable()
search options dropdown.

To enhance my accessibility for a screen reader, I want to disable non-numbers, so that we don't run into as many issues. Is there a way to do this? I'd love any tips on how to modify/validate the search field on a select.

Here's my code:
 Select::make('zip_code_id')
     ->searchable(fn)
     ->native(false)
     ->getSearchResultsUsing(fn ($livewire, string $search) => $livewire->agency->approved_zip_codes()
        ->where('zip_codes.code', 'like', "%{$search}%")
        ->limit(20)
        ->pluck('zip_codes.code', 'county_zip_code.zip_code_id')
        ->toArray()
     )
     ->required()
     ->label('Zip/Postal Code of the Request')
     ->validationAttribute('zip/postal code')
     ->reactive()
...
 Select::make('zip_code_id')
     ->searchable(fn)
     ->native(false)
     ->getSearchResultsUsing(fn ($livewire, string $search) => $livewire->agency->approved_zip_codes()
        ->where('zip_codes.code', 'like', "%{$search}%")
        ->limit(20)
        ->pluck('zip_codes.code', 'county_zip_code.zip_code_id')
        ->toArray()
     )
     ->required()
     ->label('Zip/Postal Code of the Request')
     ->validationAttribute('zip/postal code')
     ->reactive()
...
Screenshot_2025-03-20_at_1.47.34_PM.png
Screenshot_2025-03-20_at_1.47.52_PM.png
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

Add Dropdown element to Laravel Filament top bar
FilamentFFilament / ❓┊help
2y ago
How to make TextInput to allow only numbers without using numeric()
FilamentFFilament / ❓┊help
2y ago
Hide Select Dropdown depends on the Select Dropdown value?
FilamentFFilament / ❓┊help
2y ago
Filament change password in header dropdown.
FilamentFFilament / ❓┊help
3y ago