0

How I can add multiple alphanumeric characters. In regular expression we use [a-zA-z0-9 ]+, + signifies you can add atleast one alphanumeric. So, how I can achieve this through mask i.e. adding multiple alphanumeric characters.

I have tried the following:

jQuery('.alphanumeric-field').mask('A')

4
  • Does this answer your question? Mask javascript variable value Commented May 15, 2020 at 10:34
  • Are you using a third party plugin? If so which one? If not, how are you generating the .mask()? Commented May 15, 2020 at 10:36
  • I find it: $('.Address, .APT').mask('Z', { translation: { 'Z': { pattern: "^[a-zA-Z0-9_ ]*$", optional: true, recursive: true} }, maxlength: false }); Commented May 17, 2020 at 10:05
  • how to mask input such that user can enter either 5 or 9 digit: Commented May 17, 2020 at 10:08

1 Answer 1

0
$('.Address, .APT').mask('Z', {
    translation: {
      'Z': { pattern: "^[a-zA-Z0-9_ ]*$", optional: true, recursive: true}
    },
    maxlength: false
  });
Sign up to request clarification or add additional context in comments.

1 Comment

Code dumps without any explanation are rarely helpful. Stack Overflow is about learning, not providing snippets to blindly copy and paste. Please edit your question and explain how it works better than what the OP provided.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.