F
Filamentβ€’16mo ago
Noor

Phone-input mask v3

Hay I just upgraded v3 yesterday.. I'm trying to format my phone mask which is '+1 (000) 000-0000' but unable to do so with given example in v3
14 Replies
LeandroFerreira
LeandroFerreiraβ€’16mo ago
->mask('+1 (999) 999-9999') ?
Noor
NoorOPβ€’16mo ago
it doesn't work because whenever I try put phone number in field it just shows the mask number not what I entered @leandro_ferreira
LeandroFerreira
LeandroFerreiraβ€’16mo ago
Can you share an image? Any console errors?
Noor
NoorOPβ€’16mo ago
TextInput::make('phone') ->mask(RawJs::make(<<<'JS' $input.startsWith('+1') || $input.startsWith('+1') ? '+1 999 999 9999' : '+1 999 999 9999' JS)) now I'm using this is it right?? @leandro_ferreira
LeandroFerreira
LeandroFerreiraβ€’16mo ago
yep, It was supposed to work. What is the issue?
Noor
NoorOPβ€’16mo ago
this one is working but when I was using only mask that was not working
LeandroFerreira
LeandroFerreiraβ€’16mo ago
any console errors? What is your browser? what about this? ->extraAlpineAttributes(['x-mask' => '+1 999 999 9999'])
Noor
NoorOPβ€’16mo ago
no there was no error before this one worked thanks πŸ™‚
LeandroFerreira
LeandroFerreiraβ€’16mo ago
I don't know why ->mask doesn't work πŸ˜… .
Noor
NoorOPβ€’16mo ago
Yeah idk why and there was no error otherwise I would have sned u picture it 's kind of strange now when I used->mask('+1 999 999 9999') its working and if I use ->mask('+1 (000) 000-0000') then its not working ... also its happening when I use it with ->extraAlpineAttributes 🧐 @leandro_ferreira and it says The phone field format is invalid.
LeandroFerreira
LeandroFerreiraβ€’16mo ago
why 0 if the alpine pattern uses 9?
Noor
NoorOPβ€’16mo ago
then why is it not working with only mask..... it was working fine before in v2
LeandroFerreira
LeandroFerreiraβ€’16mo ago
v3 is different
Noor
NoorOPβ€’16mo ago
hmmm ok thankyou πŸ™‚
Want results from more Discord servers?
Add your server