Reputation: 763
I am using vue-the-mask and I have a simple name field. All I want is for it to only allow letters. I am not very good with regex so I'd really appreciate some help. Thanks.
<input type="text" v-model="cardName" v-mask="/[A-Za-z]/">
Currently that is not allowing any characters in the input field.
Upvotes: 0
Views: 10111
Reputation: 9
you can use v-mask="S*"
. S
means: [A-Za-z]
, *
means: infinity length
Upvotes: 0
Reputation: 11
If you want only letters, but don't know the length try -> /[A-Za-z]{0,}/
.
It will allow only letters with no limit. I am using vue-inputmask
package. The problem I am facing is how to dynamically apply mask or regex based on input value.
Upvotes: 1