This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


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: 63202
    
  69

Use a regular expression.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Need help on Unique Javascript validation
 
jQuery in Action, 3rd edition