PHP Classes

File: verification.js

Recommend this page to a friend!
  Classes of Arun Vitto   PHP OTP SMS   verification.js   Download  
File: verification.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP OTP SMS
Validate a mobile numbers sending SMS messages
Author: By
Last change:
Date: 6 years ago
Size: 1,025 bytes
 

Contents

Class file image Download
function sendOTP() { $(".error").html("").hide(); var number = $("#mobile").val(); if (number.length == 10 && number != null) { var input = { "mobile_number" : number, "action" : "send_otp" }; $.ajax({ url : 'controller.php', type : 'POST', data : input, success : function(response) { $(".container").html(response); } }); } else { $(".error").html('Please enter a valid number!') $(".error").show(); } } function verifyOTP() { $(".error").html("").hide(); $(".success").html("").hide(); var otp = $("#mobileOtp").val(); var input = { "otp" : otp, "action" : "verify_otp" }; if (otp.length == 6 && otp != null) { $.ajax({ url : 'controller.php', type : 'POST', dataType : "json", data : input, success : function(response) { $("." + response.type).html(response.message) $("." + response.type).show(); }, error : function() { alert("ss"); } }); } else { $(".error").html('You have entered wrong OTP.') $(".error").show(); } }