F
Filament11mo ago
tesse05

currency mask?

I have an input like this:
TextInput::make('amount')
->label('Import')
->mask(fn(Mask $mask) => $mask
->patternBlocks([
'money' => fn(Mask $mask) => $mask
->numeric()
->decimalPlaces(2)
->thousandsSeparator('.')
->decimalSeparator(','),
])
->pattern('money€')),
TextInput::make('amount')
->label('Import')
->mask(fn(Mask $mask) => $mask
->patternBlocks([
'money' => fn(Mask $mask) => $mask
->numeric()
->decimalPlaces(2)
->thousandsSeparator('.')
->decimalSeparator(','),
])
->pattern('money€')),
At first it shows the '€' symbol, and after trying to add a prohibitted char(like space or a letter) it shows too. But I want to show the symbol always, I mean, while I was typing.
Solution:
I don't want to use a suffix... finally I opted by using a custom field with autonumeric.
Jump to solution
3 Replies
Tieme
Tieme11mo ago
You can use prefix / suffix icon on the text field. See documentation for how to use it. https://filamentphp.com/docs/3.x/forms/fields/text-input#adding-affix-text-aside-the-field
Solution
tesse05
tesse0511mo ago
I don't want to use a suffix... finally I opted by using a custom field with autonumeric.
tesse05
tesse05OP11mo ago
final version:
Want results from more Discord servers?
Add your server