In Association with Amazon.in   Flipkart

Monday, July 6, 2020

OTP or Verification Code Authenticating Using Jquery or Ajax


To Authenticate OTP or Verification Code by using Jquery or Ajax Method:





<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/javascript">

function submitotpForm()
{
   
var    mobileverification = $("#otpverification").val();

$.ajax
  ({
  type:'post',
  url:'<?php echo base_url();?>Home/verifyotp',
data: {mobileverification},
  success:function(response) {

  if(response=="2")
  {
    
         swal("Account Created","Successfully", "success");

                   setTimeout('window.location.href = "<?php echo base_url();?>user/dashboard";',3000);
  }
  else
  {
  //  alert(response);
//$('#otp-msg').html('Invalid Otp');
swal("Invalid","Otp", "warning");
  }
  }
  });
}
</script>

No comments:

Post a Comment


Related Posts Plugin for WordPress, Blogger...