// JavaScript Document

function checkAlpha(str_id){
	obj_id = document.getElementById(str_id);
	var alphaExp1 =/^[a-z]*$/i;		
	if(!obj_id.value.match(alphaExp1)){
		return false;
	}
	return true;	
}
function checkAlphaspace(str_id){
	
	obj_id = document.getElementById(str_id);
	var alphaExp1 =/^[a-z ]*$/i;		
	if(!obj_id.value.match(alphaExp1)){
		return false;
	}
	return true;	
}
function checkLength(str_id,min_len){
	
	obj_id = document.getElementById(str_id);
	len = obj_id.value.length;	
	
	if(len<min_len){
		return false;
	}
	return true;	
}

function checkLenBetween(str_id, min_len, max_len){
	
	obj_id = document.getElementById(str_id);
	len = obj_id.value.length;	
	
	if(len>max_len || len<min_len){
		return false;
	}
	return true;		
}
	
function isPhone(s)
{
	if(s.length < 5 || s.length > 16)
		return false;
	if (isCharsInBag (s, "- +()0123456789") == false)
    {
        return false;
    }
	if(s.indexOf('+') > 0)
	{
		return false;
	}
    return true;
}

function isCharsInBag (s, bag)
{
    var i;
    // Search through string's characters one by one.
    // If character is in bag, append to returnString.
 
    for (i = 0; i < s.length; i++)
    {
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) return false;
    }
    return true;
}


/* function to check numeric value 
	return false for non-numeric value
*/

function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }


<!-- Script by hscripts.com -->

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	{
			 return false;
		  }
		}
 return true;
}



