Billing Information

<?php$quantity = $_GET["quantity"];
$total = 149 * $quantity;
?><script>jQuery(document).ready(function($) {
$("#direct").click(function() {
$("#directdiv").show();
});
$("#payfast").click(function() {
$("#directdiv").hide();
});
});function SubmitFrm() {
var thename = document.getElementById('thename').value;
var surname = document.getElementById('surname').value;
var title = document.getElementById('title').value;
var company_name = document.getElementById('company_name').value;
var email = document.getElementById('email').value;
var tel = document.getElementById('tel').value;
var town = document.getElementById('town').value;
var address = document.getElementById('address').value;
var province = document.getElementById('province').value;
var total = document.getElementById('total').value;
var quantity = document.getElementById('quantity').value; if(document.getElementById('direct').checked == true) {
var direct = document.getElementById('direct').value = 'direct';
//Male radio button is checked
}if(document.getElementById('payfast').checked == true) {
var payfast = document.getElementById('payfast').value = 'payfast';
//Female radio button is checked
} var theForm = document.getElementById("billing");
var requiredMessage = "";
var validateMessage = "";
var fullMessage = ""; if (theForm.name.value == "") {
requiredMessage += "\t* First Name.\n";
}
if (theForm.surname.value == "") {
requiredMessage += "\t* Last Name.\n";
} if (theForm.email.value == "") {
requiredMessage += "\t* Email.\n";
} else if (!isValidEmail(theForm.email.value)) {
validateMessage += "\t* Email.\n";
} if (requiredMessage != "") {
fullMessage += "These fields are required:\n"+requiredMessage;
}
if (validateMessage != "") {
fullMessage += "This field have invalid values:\n"+validateMessage;
} if (fullMessage != "") {
alert(fullMessage);
} else {
window.location.href = "/?page_id=5998&thename="+thename+"&surname="+surname+"&title="+title+"&company_name="+company_name+"&email="+email+"&province="+province+"&tel="+tel+"&town="+town+"&address="+address+"&total="+total+"&quantity="+quantity+"&direct="+direct+"&payfast="+payfast;
} }function isValidEmail(strEmail){
validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
// search email text for regular exp matches
if (strEmail.search(validRegExp) == -1) {
return false;
}
return true;
}/**
* DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
*/
function echeck(str) {
var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if (str.indexOf(at)==-1){
//alert("Invalid E-mail ID")
return false
} if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
//alert("Invalid E-mail ID")
return false
} if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
//alert("Invalid E-mail ID")
return false
} if (str.indexOf(at,(lat+1))!=-1){
//alert("Invalid E-mail ID")
return false
} if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
//alert("Invalid E-mail ID")
return false
} if (str.indexOf(dot,(lat+2))==-1){
//alert("Invalid E-mail ID")
return false
} if (str.indexOf(" ")!=-1){
//alert("Invalid E-mail ID")
return false
} return true
}
</script>
<div class="leftCol">
<form id="billing">
<h1>YOUR INFORMATION</h1>
<p><br /><br />Title*<br />
<select name="title" id="title">
<option>Title</option>
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Dr">Dr</option>
<option value="Miss">Miss</option>
</select>
</p>
<div class="left"> <p>First Name*<br /><input name="name" id="thename" type="text" /></p></div>
<div class="right"><p>Last Name*<br /><input name="surname" id="surname" type="text" /></p></div>
<div class="clear"></div> <div class="left"><p>Company Name<br /><input name="company_name" id="company_name" type="text" /></p></div>
<div class="right"><p>Email Address*<br /><input type="text" id="email" name="email" /></p></div>
<div class="clear"></div> <div class="left"><p>Tel Number*<br /><input name="tel" id="tel" type="text" /></p></div>
<div class="right"><p>Town/City*<br /><input type="text" id="town" name="town" /></p></div>
<div class="clear"></div>
<p>Ă–rder Notes<br /><textarea name="address" placeholder="Note about your order, e.g special notes for delivery" id="address">