This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes JavaScript alphanumeric 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 "JavaScript alphanumeric validation" Watch "JavaScript alphanumeric validation" New topic

JavaScript alphanumeric validation

Rinkit Shah

Joined: Aug 16, 2011
Posts: 26
I want to validate a login field such that it is mandatory for the user to enter both numbers as well as alphabets can anyone give a hint on this.
Thanks in advance.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60752

Where's your code so far? What problems are you having with it?

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rinkit Shah

Joined: Aug 16, 2011
Posts: 26

Thanks Bear next time I will take care of putting my comments in relevant forum.

I have made validation

frmvalidator.addValidation("loginName","req","Please enter your Login Name");
frmvalidator.addValidation("loginName","maxlen=20", "Max length for Login Name is 20");

same I can include as alnum instead of req field for accepting only alphanumeric characters but it is not working properly so needed some guidance on this.
It is sorta covered in the JavaRanch Style Guide.
subject: JavaScript alphanumeric validation
Similar Threads
Is return message depiction valid UML notations ?
NoClassDefFoundError - ValidateEventListener
SCJA Certification expiration ?
use case;