
 document.write(" <FORM ACTION=order-form2.php METHOD=post ONSUBMIT='return validation2();' NAME=form2>"+
                       " <TABLE WIDTH=225 BORDER=0 VSPACE=0 HSPACE=0 CELLPADDING=5 CELLSPACING=0>"+
                       "   <TR>"+
                       "     <TD CLASS=white-font11 ALIGN=RIGHT><B>Name:</B></TD>"+
                       "     <TD ALIGN=LEFT><INPUT NAME=name TYPE=TEXT CLASS=textbox ID=name></TD>"+
                       "   </TR>"+
                        "  <TR>"+
                         "  <TD CLASS=white-font11 ALIGN=RIGHT><B>Email:</B>"+
                         "   </TD>"+
                        "    <TD ALIGN=LEFT><INPUT NAME=email TYPE=TEXT CLASS=textbox ID=email></TD>"+
                       "  </TR>"+
                        "  <TR>"+
                        "    <TD CLASS=white-font11 ALIGN=RIGHT><B>Phone:</B>"+
                         "   </TD>"+
                          "  <TD ALIGN=LEFT><INPUT NAME=phone TYPE=TEXT CLASS=textbox ID=phone></TD>"+
                        "  </TR>"+
                      "    <TR>"+
                      "     <TD CLASS=white-font11 VALIGN=TOP ALIGN=RIGHT><B>Comments:</B>"+
                       "    </TD>"+
      "   <TD VALIGN=TOP ALIGN=LEFT><TEXTAREA NAME=comments COLS=30 ROWS=5 CLASS=textarea ID=comments></TEXTAREA></TD>"+
                        "  </TR>"+
                        "  <TR>"+
                        "    <TD></TD>"+
                         "   <TD ALIGN=RIGHT><INPUT NAME=Submit2 TYPE=SUBMIT CLASS=submit-button ID=Submit2 VALUE=></TD>"+
                        "  </TR>"+
                      "  </TABLE>"+
					  "</FORM>");
 
 
 
 
 
 
 
 function validation()
{
if(document.form1.name.value==''){
     alert("Please Enter Your Name");
document.form1.name.focus();
	 return false;
  }
 else if(!(CheckAlphabet(document.form1.name.value)))
	 {
	   alert ("Please Enter a Valid Full Name  (eg.  A-Z,a-z).");
	   document.form1.name.focus();
	   return false;
	  }
	  else if(document.form1.name.value.length<3)
	  {
	 alert("please enter name atleast 3 char");
	 document.form1.name.focus();
	 return false;
	 }
	 
	 	 if(document.form1.phone.value==''){
     alert("Please Enter Your  phone");
document.form1.phone.focus();
	 return false;
  }else if(!( CheckDigits(document.form1.phone.value)))
  {
  alert ("Please Enter a Valid phone  (eg. 9213779889).");
	   document.form1.phone.focus();
	   return false;
  }
  
	 	if(document.form1.email.value==""){
			alert("Please Enter Email Address");
			document.form1.email.focus();
			return false;
		}
		if(document.form1.email.value.indexOf("@") < 0 || document.form1.email.value.indexOf(".") < 0) {
			alert("Incorrect Email Address! Use as abc@xyz.com");
			document.form1.email.focus();
			return false;
		}
	

	 
	 ///address validation
	 

}

//////////////  Second right form

function validation2()
{
if(document.form2.name.value==''){
     alert("Please Enter Your Name");
document.form2.name.focus();
	 return false;
  }
 else if(!(CheckAlphabet(document.form2.name.value)))
	 {
	   alert ("Please Enter a Valid Full Name  (eg.  A-Z,a-z).");
	   document.form2.name.focus();
	   return false;
	  }
	  else if(document.form2.name.value.length<3)
	  {
	 alert("please enter name atleast 3 char");
	 document.form2.name.focus();
	 return false;
	 }
	 
	 	
  
	 	if(document.form2.email.value==""){
			alert("Please Enter Email Address");
			document.form2.email.focus();
			return false;
		}
		if(document.form2.email.value.indexOf("@") < 0 || document.form2.email.value.indexOf(".") < 0) {
			alert("Incorrect Email Address! Use as abc@xyz.com");
			document.form2.email.focus();
			return false;
		}
	
 if(document.form2.phone.value==""){
     alert("Please Enter Your  phone");
document.form2.phone.focus();
	 return false;
  }else if(!( CheckDigits(document.form2.phone.value)))
  {
  alert ("Please Enter a Valid phone  (eg. 9213779889).");
	   document.form2.phone.focus();
	   return false;
  }
	 
	 ///address validation
	 

}

////////////// second right form

///////////////function defination///////
function CheckDigits(TheNumber) 
{
	var valid = 1
	var GoodChars = "0123456789-+(). "
	var i = 0
		if (TheNumber=="") {
		// Return false if number is empty
		valid = 0
		}
	for (i =0; i <= TheNumber.length -1; i++) {
			if (GoodChars.indexOf(TheNumber.charAt(i)) == -1) {
			// Note: Remove the comments from the following line to see this
			// for loop in action.
			// alert(TheNumber.charAt(i) + " is no good.")
			valid = 0
			} // End if statement
		} // End for loop
return valid
}
function CheckAlphabet(character) {

var valid = 1

character=character.toUpperCase();



var GoodChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ. "

var GoodChars1 = " "


var i = 0

if (character=="") {

// Return false if number is empty

valid = 0

}

for (i =0; i <= character.length -1; i++) {

if (GoodChars.indexOf(character.charAt(i)) == -1) {

// Note: Remove the comments from the following line to see this

// for loop in action.

// alert(character.charAt(i) + " is no good.")

valid = 0

} // End if statement



} // End for loop

return valid

}


function IsValid( oField )

{

  if (oField.name=='email')

    {

        re = /^(([a-z\._\-0-9])+\@([a-z\._\-0-9])+\.([a-z])+)?$/i;

        $sMsg = "E-Mail is invalid.\E-Mail should be in user@domain.com format."

    }

 

 if (oField.name=='pcode2')

    {

        re = /^((([0-9]))*)*$/i;

        $sMsg = " Postcode entered is invalid.\Postcode entered should contain only numericals."

    }

	

	

	if (oField.name=='mobile1')

    {

        re = /^((([0-9]))*)*$/i;

        $sMsg = "Mobile No. entered is invalid.\Mobile entered should contain only numericals."

    }

 

 

   if ( !re.test(oField.value) )

    {

        alert( $sMsg );

        oField.value = '';

        oField.focus();

        return false;

    }

}
