igorescobar / jQuery-Mask-Plugin

A jQuery Plugin to make masks on form fields and HTML elements.
http://igorescobar.github.io/jQuery-Mask-Plugin/
Other
4.77k stars 1.42k forks source link

How to make a class that prevents number and symbol input? #722

Open gabrielfm92 opened 5 years ago

gabrielfm92 commented 5 years ago

I'm having a problem at my wordpress site where I can't upload your pugin into it because it says "no valid plugins found"... anyways... I'm using the tutorial from your friends at https://netviber.com.br/blog/aplicando-mascaras-no-formulario-do-contact-form-7/ on my contact form 7's form. The sp_celphones part works perfectly, but I also need a textbox that the user can only input letters...

I tried putting this on the exemple.js:

$('#nomess').mask('ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ', { translation: { 'Z': { pattern: /[a-zA-Z ]/ } } });

and my textbox like this:

(I tried at http://jsfiddle.net/igorescobar/6pco4om7/ and it worked)

No matter what I do with this class, I can't get it to let only letters be inputted... any hints? (@igorescobar I will donate if you help me solve this)