Input masking
Hi, guys. I am using text fields and I need to apply validations For example, TextInput::make('name')
->regex('/^[a-zA-Z\s-+.,/?><:;[]{}|`~=_']*$/')
->minLength(2)
->maxLength(50)
->required(), How can I use to validate the field in real time, not only on the save/create event? For example I don't want to let the user to type numbers. I was trying to use input masking but it doesn't work or I didn't know how to use it. If the input masking doesn't work, how can I show the error when the user is typing something wrong?
9 Replies
Make it reactive
Ok, and then what should I use?
it will remove .defer from the field
I am sorry if I'm asking too much, but can you show me an example? Thank you π
So I need to use reactive and regex validation like in my exmaple?
as i said reactive just removes .defer
check livewire docs what it means
https://laravel-livewire.com/docs/2.x/properties#binding-nested-data
I think you can use ->reactive() combined with Livewires validateOnly()
ok, thank you, guys