GIF89a
function saveDebit2(ops,srr) { var uname=$("#uname").val(); var datee=$("#datee").val(); var type=$("#type").val(); var weight=$("#weight").val(); var actual_price=$("#actual_price").val(); if(uname=="") { alert("Enter user name"); $("#uname").focus(); return false; } if(datee=="") { alert("Select date"); $("#datee").focus(); return false; } if(type=="") { alert("Select type"); $("#type").focus(); return false; } if(weight=="") { alert("Enter weight"); $("#weight").focus(); return false; } if(actual_price=="") { alert("Enter actual price"); $("#actual_price").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.reload(); } else { alert("Unable to save data."); window.location.reload(); } } }; if(ops==1) { xmlhttp.open("GET","saveDebit2.php?uname="+uname+"&type="+type+"&datee="+datee+"&weight="+weight+"&actual_price="+actual_price,true); } else { xmlhttp.open("GET","updateDebit2.php?uname="+uname+"&type="+type+"&srr="+srr+"&datee="+datee+"&weight="+weight+"&actual_price="+actual_price,true); } xmlhttp.send(); }