allowing only letters in the input with jquery Mask

Asked

Viewed 5,011 times

0

You can only allow letters in input with jquery Mask?

I’m using this plugin: Jquery Mask Plugin

  • In the documentation it says this: "A (Numbers and Letters), S (A-Za-z)". So I think in your case use the "S" as letter mask.

  • Could you set an example for me?

  • A reply with example has already been posted.

1 answer

3


$(document).ready(function(){
  $('#letras').mask('SSSS');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.8/jquery.mask.js"></script>

<input type="text" id="letras">

According to the documentation, you can use the letter S to specify upper and lower case letters.

'S': {pattern: /[a-zA-Z]/}
  • vle thank you so much

Browser other questions tagged

You are not signed in. Login or sign up in order to post.