Web Development

Alphanumeric test by JavaScript

Verifying alphanumeric test by JavaScript:

function alphanumeric(alphane){
   var numaric = alphane;
   for(var j=0; j<numaric.length; j++){
      var alphaa = numaric.charAt(j);
      var hh = alphaa.charCodeAt(0);
      if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123)) {
      }else {
         alert("Your Alpha Numeric Test Failed");
         return false;
      }
   }
   return true;
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s