• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help on Unique Javascript validation

 
Avinash Talari
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help me in writing a javascript to validate string of the format "A23d:1234". First four digits of alphanumeric characters and then a colon and then four numeric characters. I am inputting 5 different strings of this format into a text area which has 5 rows ..each limited to 9 characters. If the format fails for any of the row an alert should be thrown. I am trying to use the substring function but facing issues in validating the string of each row.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65217
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a regular expression.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic