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