GIF89a
function saveShipAddress(user_id){ document.getElementById("overlay").style.display = "block"; var name=$("#name2").val(); var email=$("#email2").val(); var company=$("#company2").val(); var mobile=$("#mobb2").val(); var address=$("#add2").val(); var landmark=$("#landmark2").val(); var country=$("#billingcountryId2").val(); var state=$("#billingstateid").val(); var city=$("#city2").val(); var pincode=$("#pincode2").val(); if(name=="") { document.getElementById("overlay").style.display = "none"; alert("Invalid name"); $("#name2").focus(); return true; } var regexp; regexp = /^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i; if (!regexp.test(email)) { document.getElementById("overlay").style.display = "none"; alert("Enter valid email id"); $("#email2").focus(); return false; } if (email == "") { document.getElementById("overlay").style.display = "none"; alert("Enter valid email id"); $("#email2").focus(); return false; } if (email.length < 6) { document.getElementById("overlay").style.display = "none"; alert("Enter valid email id"); $("#email2").focus(); return false; } if (email.length > 180) { document.getElementById("overlay").style.display = "none"; alert("Enter valid email id"); $("#email2").focus(); return false; } if(company=="") { document.getElementById("overlay").style.display = "none"; alert("Invalid company"); $("#company2").focus(); return true; } if(mobile.length<10) { document.getElementById("overlay").style.display = "none"; alert("Invalid mobile number"); $("#mobb2").focus(); return true; } if(mobile.length>10) { document.getElementById("overlay").style.display = "none"; alert("Invalid mobile number"); $("#mobb2").focus(); return true; } if(address=="") { document.getElementById("overlay").style.display = "none"; alert("Invalid address"); $("#add2").focus(); return true; } if(landmark=="") { document.getElementById("overlay").style.display = "none"; alert("Invalid landmark"); $("#landmark2").focus(); return true; } if(country=="") { document.getElementById("overlay").style.display = "none"; alert("Invalid country"); $("#billingcountryId2").focus(); return true; } if(state=="") { document.getElementById("overlay").style.display = "none"; alert("Invalid state"); $("#billingstateid").focus(); return true; } if(city=="") { document.getElementById("overlay").style.display = "none"; alert("Invalid city"); $("#city2").focus(); return true; } if(pincode=="") { document.getElementById("overlay").style.display = "none"; alert("Invalid pincode"); $("#pincode2").focus(); return true; } if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (this.readyState==4 && this.status==200) { if(this.responseText==1) { document.getElementById("overlay").style.display = "none"; window.location.href = ("order-overview.php"); } else if(this.responseText==0) { document.getElementById("overlay").style.display = "none"; alert("Error : Dear customer, we are sorry. we cant proceed your right now, Please try again later"); } } }; console.log("saveShipAddress.php?user_id="+user_id+"&name="+name+"&email="+email+"&company="+company+"&mobile="+mobile+"&address="+address+"&landmark="+landmark+"&country="+country+"&state="+state+"&city="+city+"&pincode="+pincode); xmlhttp.open("GET","saveShipAddress.php?user_id="+user_id+"&name="+name+"&email="+email+"&company="+company+"&mobile="+mobile+"&address="+address+"&landmark="+landmark+"&country="+country+"&state="+state+"&city="+city+"&pincode="+pincode,true); xmlhttp.send(); }