Phone number to obtain the verification code, verify that the verification code is correct

Source: Internet
Author: User

}else {
Alert ("Verification code sent, please pay attention to check");
Time ();//Call Verification code Countdown
document.getElementById (' Iputcode '). SetAttribute (' class ', result);//Let the element be added CALSS
}

/**
* Show Countdown time after clicking get Verification code
*/
var wait = 60;//definition SMS Send countdown time
function Time () {
Ocument.getelementbyid (' obtain '). Disabled = false; Allow the button to click
if (wait = = 0) {
document.getElementById (' obtain '). RemoveAttribute ("Disabled"); The control button can be clicked
document.getElementById (' obtain '). Value = "Get Verification Code";
document.getElementById (' obtain '). Style.color = ' #2C8FFF ';
wait = 60; Restore Countdown
}else{
document.getElementById (' obtain '). SetAttribute ("Disabled", true);//control button not clickable
document.getElementById (' obtain '). Value = "Resend (" + Wait + ")";
document.getElementById (' obtain '). Style.color = ' #C0BBBB ';
wait--;
SetTimeout (' Time () ', 1000)//Cyclic call
}
}

/**
* Verify that the verification code is correct
*/
function Verify () {
var yzm = document.getElementById (' Iputcode '). Value; Obtain the verification code that the registered user fills in
var yzmtwo = document.getElementById (' Iputcode '). ClassName; Verification code sent by the system
if (Yzm = = "") {
Alert ("Verification code cannot be empty");
return false;
}else if (yzm! = yzmtwo) {
Alert ("Verification code error, please re-enter!") ");
Eturn false;
}
return true;
}

Click Next to verify that the verification code is correct

$ (function () {

Next
$ (' #nextStep '). Click (function () {
var ipone = Isipone ($ (' #loginPhone '). Val ());//Mobile number verification
var loginphone = document.getElementById (' Loginphone '). value;//get the user's mobile number

if (ipone! = True) {
Return
}
var yzm = verify ();//call validation method here
if (Yzm! = True) {
Return
}
if (Ipone = = True && Yzm = = True) {
Next Jump Set Password page
window.open (' resetpassword.html?iphone= ' +loginphone)
}
})

})

Phone number to obtain the verification code, verify that the verification code is correct

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.