Two Laptop Bag*
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 Murach's Java Servlets and JSP this week in the Servlets 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
Author

Need help on Unique Javascript validation

Avinash Talari
Greenhorn

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
Marshal

Joined: Jan 10, 2002
Posts: 60748
    
  65

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
GridLayout
Using expand/collapse with dataTable JSF Components
Need Help for word game
Adding grids in MapBacked form