File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes textbox validation in javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "textbox validation in javascript" Watch "textbox validation in javascript" New topic
Author

textbox validation in javascript

Yell Srik
Ranch Hand

Joined: Mar 10, 2004
Posts: 61
I want to do a validation of my checkbox so that the only valid values that are allowed are
a to z, A to Z, aa to zz and AA to ZZ.

i am using the following code to acheive this:



But it is displaying the alert message even if i enter a valid value like 'aa'?

Can u tell me where i am going wrong?? I want to know if my reference string is given properly?

Thanks in advance.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
um, why are you checking for 1 when it is returning true/false?

Eric
 
Consider Paul's rocket mass heater.
 
subject: textbox validation in javascript