GIF89a
function saveAddress(redirect) { var adds=$("#adds").val(); var landmark=$("#landmark").val(); var pincode=$("#pincode").val(); var uname=$("#uname").val(); var mobb=$("#mobb").val(); if(adds=="") { popUP("Enter address"); $("#adds").focus(); return false; } if(adds.length<10) { popUP("Invalid address"); $("#adds").focus(); return false; } if(pincode=="") { popUP("Enter pincode"); $("#pincode").focus(); return false; } if(pincode.length!=6) { popUP("Invalid pincode"); $("#pincode").focus(); return false; } if(uname=="") { popUP("Enter user name"); $("#uname").focus(); return false; } if(mobb=="") { popUP("Enter mobile number"); $("#mobb").focus(); return false; } if(mobb.length!=10) { popUP("Invalid mobile number"); $("#mobb").focus(); return false; } 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) { window.location.href = (redirect) } else { popUP("Unable to save address"); } } }; xmlhttp.open("GET","saveAddress.php?adds="+adds+"&landmark="+landmark+"&uname="+uname+"&mobb="+mobb+"&pincode="+pincode,true); xmlhttp.send(); } function popUP(msgg) { var x = document.getElementById("snackbar"); $("#snack_msgg").html(msgg); x.className = "show"; setTimeout(function(){ x.className = x.className.replace("show", "Hello"); }, 2500); }