0

I don't know if this question has already been answer before. What I'm trying to do is validate an input text, but i need the length to be less than 10 characters and I need the 4 first characters to be Letters only and the rest only Numbers

how can i achieve this using the jQuery Validation Plugin?, i chose to use this plugin because it seems to be the easiest way

  • Possible duplicate of [jQuery validation plugin: accept only alphabetical characters?](https://stackoverflow.com/questions/2794162/jquery-validation-plugin-accept-only-alphabetical-characters) – Patrick Oct 07 '17 at 19:01

1 Answers1

-1
$("form").validate({
  rules: {
    myField: { lettersonly: true }
  }
});

To ensure the max lenth, use the maxlengh attribute.

If you nee to only check the first 4 characters for alpha ... roll your own.

Patrick
  • 5,526
  • 14
  • 64
  • 101