File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 60050

Use a regular expression.

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