User input check on relevant mask



  • How to verify that the user ' s information corresponds to the following entry mask:

    The information is divided into four sub-groups as a divider using a symbol - Each sub-group may have English alphabet symbols in different registers and figures, e.g. w34p-TdhO-8ZpC-zWpO

    Do you know how js would look like a validation of this condition?



  • Here's the regular:

    ^([A-Za-z0-9]{4}-){3}[A-Za-z0-9]{4}$
    

    Here's a little example in js. http://jsfiddle.net/zaebiz/utezhj2o/

    If you want to validate the direct input, use his attribute pattern with the above regular expression.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2