wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Need help on Unique Javascript validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Need help on Unique Javascript validation" Watch "Need help on Unique Javascript validation" New topic

Need help on Unique Javascript validation

Avinash Talari

Joined: May 12, 2010
Posts: 3
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

Joined: Jan 10, 2002
Posts: 60785

Use a regular expression.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
It is sorta covered in the JavaRanch Style Guide.
subject: Need help on Unique Javascript validation
Similar Threads
Hibernate Query Doubt
Using expand/collapse with dataTable JSF Components
Need Help for word game
Adding grids in MapBacked form