© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
7 replies
Ties Pol

Textinput masking with alpine not working

The following code gives an error about not able to find $input. This is code from the v3 documentation. What am I doing wrong?
TextInput::make('cardNumber')
    ->mask(RawJs::make(<<<JS
        $input.startsWith('34') || $input.startsWith('37') ? '9999 999999 99999' : '9999 9999 9999 9999'
    JS))
TextInput::make('cardNumber')
    ->mask(RawJs::make(<<<JS
        $input.startsWith('34') || $input.startsWith('37') ? '9999 999999 99999' : '9999 9999 9999 9999'
    JS))
Solution
I've found my answer. The problem was a semicolon in the end of the JS.
TextInput::make('cost_price')
->prefix('€')
->mask(RawJs::make(<<<'JS'
     $money($input, ',', '.', 4)
JS
)),
TextInput::make('cost_price')
->prefix('€')
->mask(RawJs::make(<<<'JS'
     $money($input, ',', '.', 4)
JS
)),
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

dispatch with alpine is not working
FilamentFFilament / ❓┊help
13mo ago
->maxLength() not working on textinput
FilamentFFilament / ❓┊help
2y ago
Autocomplete not working in textinput
FilamentFFilament / ❓┊help
2y ago
->extraAttribute not working on TextInput
FilamentFFilament / ❓┊help
3y ago