GIF89a php
Current File : /home/hencockfreshchic/public_html/app/js/updateUserDetails.js
function updateUserDetails()
{
	var uname=$("#uname").val();
	var password=$("#password").val();
	var mobb=$("#mobb").val();

	if(uname=="")
	{
		popUP("Enter name");
		$("#uname").focus();
		return false;
	}
	if(uname.length<3 && uname.length>30)
	{
		popUP("Invalid name");
		$("#uname").focus();
		return false;
	}
	if(password=="")
	{
		popUP("Enter password");
		$("#password").focus();
		return false;
	}
	if(password.length<3 && password.length>30)
	{
		popUP("Invalid password");
		$("#password").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 = ("myAccount.php")
      }
      else
      {
      	popUP("Unable to update data.");
      }
	}
  };
  xmlhttp.open("GET","updateUserDetails.php?uname="+uname+"&password="+password+"&mobb="+mobb,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);
}