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