// Start Checking for email address.
function checkData(){
  if(document.thisForm.email.value.length==0){
  alert("Please enter your E-Mail Address")
  thisForm.email.focus();
  return false}
  i=document.thisForm.email.value.indexOf("@")
  j=document.thisForm.email.value.indexOf(".",i)
  k=document.thisForm.email.value.indexOf(",")
  kk=document.thisForm.email.value.indexOf(" ")
  jj=document.thisForm.email.value.lastIndexOf(".")+1
  len=document.thisForm.email.value.length
if ((i>0) && (j>(1+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3)){
}
 else {
   alert("Please enter an exact email address.\n" + document.thisForm.email.value + " is invalid.")
   document.thisForm.email.focus();
   return false}
}
// End Checking for Email address.





// Start of checking Zip code

function _CF_checkzip(object_value)
    {
    if (object_value.length == 0)
        return true;
		
    if (object_value.length != 5 && object_value.length != 10)
        return false;

	// make sure first 5 digits are a valid integer
	if (object_value.charAt(0) == "-" || object_value.charAt(0) == "+")
        return false;

	if (!_CF_checkinteger(object_value.substring(0,5)))
		return false;

	if (object_value.length == 5)
		return true;
	
	// make sure

	// check if separator is either a'-' or ' '
	if (object_value.charAt(5) != "-" && object_value.charAt(5) != " ")
        return false;

	// check if last 4 digits are a valid integer
	if (object_value.charAt(6) == "-" || object_value.charAt(6) == "+")
        return false;

	return (_CF_checkinteger(object_value.substring(6,10)));
    }

// end of checking Zip code

function _CF_hasValue(obj, obj_type)
    {
    if (obj_type == "TEXT" || obj_type == "PASSWORD")
	{
    	if (obj.value.length == 0) 
      		return false;
    	else 
      		return true;
    	}
    else if (obj_type == "SELECT")
	{
        for (i=0; i < obj.length; i++)
	    	{
		if (obj.options[i].selected)
			return true;
		}

       	return false;	
	}
    else if (obj_type == "SINGLE_VALUE_RADIO" || obj_type == "SINGLE_VALUE_CHECKBOX")
	{

		if (obj.checked)
			return true;
		else
       		return false;	
	}
    else if (obj_type == "RADIO" || obj_type == "CHECKBOX")
	{

        for (i=0; i < obj.length; i++)
	    	{
		if (obj[i].checked)
			return true;
		}

       	return false;	
	}
	}


function _CF_checkinteger(object_value)
    {
    //Returns true if value is a number or is NULL
    //otherwise returns false	

    if (object_value.length == 0)
        return true;

    //Returns true if value is an integer defined as
    //   having an optional leading + or -.
    //   otherwise containing only the characters 0-9.
	var decimal_format = ".";
	var check_char;

    //The first character can be + -  blank or a digit.
	check_char = object_value.indexOf(decimal_format)
    //Was it a decimal?
    if (check_char < 1)
	return _CF_checknumber(object_value);
    else
	return false;
    }
	
function _CF_checknumber(object_value)
    {
    //Returns true if value is a number or is NULL
    //otherwise returns false	

    if (object_value.length == 0)
        return true;

    //Returns true if value is a number defined as
    //   having an optional leading + or -.
    //   having at most 1 decimal point.
    //   otherwise containing only the characters 0-9.
	var start_format = " .+-0123456789";
	var number_format = " .0123456789";
	var check_char;
	var decimal = false;
	var trailing_blank = false;
	var digits = false;

    //The first character can be + - .  blank or a digit.
	check_char = start_format.indexOf(object_value.charAt(0))
    //Was it a decimal?
	if (check_char == 1)
	    decimal = true;
	else if (check_char < 1)
		return false;
        
//Remaining characters can be only . or a digit, but only one decimal.
	for (var i = 1; i < object_value.length; i++)
	{
		check_char = number_format.indexOf(object_value.charAt(i))
		if (check_char < 0)
			return false;
		else if (check_char == 1)
		{
			if (decimal)		// Second decimal.
				return false;
			else
				decimal = true;
		}
		else if (check_char == 0)
		{
			if (decimal || digits)	
				trailing_blank = true;
        // ignore leading blanks

		}
	        else if (trailing_blank)
			return false;
		else
			digits = true;
	}	
    //All tests passed, so...
    return true
    }


<!-- The code is end for credit validation  -->
	
	
	
	
function isRequired(thisForm)
	    {

			if (thisForm.user.value == "")
			 {
			        alert("The User login Name field is requried. please fill it in.");
					document.thisForm.user.focus();
                    return (false);	
	              }
				  
            if (thisForm.user.value.length < 3)	
			{
			        alert("The User login name should be at least 3 character's ." );
					document.thisForm.user.focus();
                    return (false);	

			     } 
			if (thisForm.pass.value == "")
			 {
			        alert("The User Password field is required. please fill it in.");
					document.thisForm.pass.focus();
                    return (false);
				   }	
			
         	if (thisForm.pass.value.length < 6)	
			 {
		  	        alert("The User password should be at least 6 character's ." );
					document.thisForm.pass.focus();
                    return (false);
	           }
		   
			if (thisForm.repass.value == "")
			 {
			        alert("Please type Password again is required.");
					document.thisForm.repass.focus();
                    return (false);
				   }		   
	   	
           
		   if (thisForm.repass.value.length < 6)	
			 {
		  	        alert("The User password should be at least 6 character's ." );
					document.thisForm.repass.focus();
                    return (false);
	           }
		   
		   if (thisForm.pass.value != thisForm.repass.value)	
			 {
		  	        alert("Your both password has different value pls put same password in the releted field's ." );
					document.thisForm.repass.focus();
                    return (false);
	           }
		   
		   if(thisForm.pw_q.selectedIndex==0)
              {
               alert('The Password questiom field is required. please fill it in.');
               document.thisForm.pw_q.focus();
               return (false);
               }

		  if (thisForm.pw_a.value == "")
			 {
			        alert("The Password answer field is required. please fill it in.");
					document.thisForm.pw_a.focus();
                    return (false);
				   } 
				   
		  if (thisForm.pw_a.value.length >= 30)	
			 {
		  	        alert("Your security answer should be not more then 30 character's ." );
					document.thisForm.pw_a.focus();
                    return (false);
	           }
			
		if (thisForm.cmpname.value == "")
			 {
			        alert("The Company Name field is required. please fill it in.");
					document.thisForm.cmpname.focus();
                    return (false);
				   }		   
				
		if (thisForm.cmpname.value.length >= 30)	
			 {
		  	        alert("The Company Name should not be more then 30 character's ." );
					document.thisForm.cmpname.focus();
                    return (false);
	           }		   	   
			
			if (thisForm.comppro.value == "")
			 {
			        alert("The Company Profile field is required. please fill it in.");
					document.thisForm.comppro.focus();
                    return (false);
				   }		   
				
				if (thisForm.cmpname.value.length >= 250)	
			 {
		  	        alert("The Company Profile should not be more then 250 character's ." );
					document.thisForm.cmpname.focus();
                    return (false);
	           }		   
				
			if (thisForm.cp_name.value == "")
			 {
			        alert("The Contact Person Name field is required. please fill it in.");
					document.thisForm.cp_name.focus();
                    return (false);
				   }
			
			if (thisForm.caddress1.value == "")
			 {
			        alert("The Address field is required. please fill it in.");
					document.thisForm.caddress1.focus();
                    return (false);
				   }		
			
			
			if(document.thisForm.country.selectedIndex==0)
              {
               alert('The country field is required. please fill it in.');
               document.thisForm.country.focus();
               return (false);
               }
			   
			if (document.thisForm.city.selectedIndex==0)
			 {
			        alert("The city field is required. please fill it in.");
					document.thisForm.city.focus();
                    return (false);
				   }
				   
			if (document.thisForm.state.selectedIndex==0)
			 {
			        alert("The state field is required. please fill it in.");
					document.thisForm.state.focus();
                    return (false);
				   }

           if (document.thisForm.post_code.value == "")
			 {
			        alert("The post code field is required. please fill it in.");
					document.thisForm.post_code.focus();
                    return (false);
				   }	
			
			   if(isNaN(thisForm.post_code.value))
   			 {
			        alert("The isd code should be integer. please fill only interger value.");                  document.thisForm.post_code.value = "";    
					document.thisForm.post_code.focus();
                    return (false);
				   }	
			  	
			if (thisForm.isd_code.value == "")
			 {
			        alert("The isd code field is required. please fill it in.");
					document.thisForm.isd_code.focus();
                    return (false);
				   }	
				   
		    if(isNaN(thisForm.isd_code.value))
   			 {
			        alert("The isd code should be integer. please fill only interger value.");
					document.thisForm.isd_code.focus();
                    return (false);
				   }	
		              
			
			if (thisForm.std_code.value == "")
			 {
			        alert("The std code field is required. please fill it in.");
					document.thisForm.std_code.focus();
                    return (false);
				   }	
			
			 if(isNaN(thisForm.std_code.value))
   			 {
			        alert("The std code should be integer. please fill only interger value.");
					document.thisForm.isd_code.focus();
                    return (false);
				   }	
			
			if (thisForm.phone.value == "")
			 {
			        alert("The phone number field is required. please fill it in.");
					document.thisForm.std_code.focus();
                    return (false);
				   }		
			
			 if(isNaN(thisForm.phone.value))
   			 {
			        alert("The phone number should be integer. please fill only interger value.");
					document.thisForm.isd_code.focus();
                    return (false);
				   }
				   
				   if (thisForm.email.value == "")
			 {
			        alert("The email field is required. please fill it in.");
					document.thisForm.email.focus();
                    return (false);
				   }	
		if (thisForm.occupation.value == "")
			 {
			        alert("The occupation field is required. please fill it in.");
					document.thisForm.occupation.focus();
                    return (false);
				   }	
			  
		if(document.thisForm.sector.selectedIndex==0)
              {
               alert('The Sector field is required. please fill it in.');
               document.thisForm.sector.focus();
              return (false);
               }			   
					   
				
     		
 }