In Association with Amazon.in   Flipkart

Monday, July 6, 2020

Authenticate Login Details Through Jquery/Ajax Method

When Submit Login Form, With out Refresh the page to authentication login details through Jquery/Ajax method.


<script>
// ************* login sub ====================
function  submitloginForm()
{
var mydatalogin= $("#myloginform").serialize();
$.ajax
  ({
  type:'post',
 url:'<?php echo base_url();?>Home/checklogin',
data:mydatalogin,
  success:function(response) {

  if(response=="success")
  {
     $('#logindiv').val('Signing in...');
          swal("We are checking","your details.....", "success");

                    setTimeout('window.location.href = "<?php echo base_url();?>user/dashboard";',2000);
  }
  else
  {
swal("Invalid","Login Credentials", "warning");
  }
  }
  });
}

// ****************************************
</script>


No comments:

Post a Comment


Related Posts Plugin for WordPress, Blogger...