Crystal
Posts: 0
Joined: Mon Nov 25, 2013 8:49 am

When sending phone verification code, plus some JS code judgments can not be repeated within 60 seconds to send the veri

But something is wrong,there was nothing happend.
I have added a JavaScript like this :

var wait = 60;
function time(o) {
if (wait == 0) {
o.removeAttribute("disabled");
o.value = "Get Code";
wait = 60;
} else {
o.setAttribute("disabled", true);
o.value = "Resend(" + wait + ")";
wait--;
setTimeout(function() {
time(o)
},
1000)
}
}

When in the Send Code Click button ,run javascript like this :

Appery('button_token').addClass('ui-disabled');
Appery('button_token').onclick=function(){time(this);}

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

When sending phone verification code, plus some JS code judgments can not be repeated within 60 seconds to send the veri

Hi,

Where exactly you add this code?
Are there any errors in console?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

When sending phone verification code, plus some JS code judgments can not be repeated within 60 seconds to send the veri

Hello!
Do you want to add to button Click handler another handler? That's enough just to call pretime(this);/pre instead preAppery('button_token').onclick=function(){time(this);} /prePlease also note it's not correct. Should be preAppery('button_token').on("click",function(){time(this);});)/pre

Crystal
Posts: 0
Joined: Mon Nov 25, 2013 8:49 am

When sending phone verification code, plus some JS code judgments can not be repeated within 60 seconds to send the veri

Hello,
How to enabled button.I have tried many methods
Appery('button_token').attr('enabled','enabled');
Appery('button_token').attr('enabled',null);
Appery('button_token').enabled = true;
Appery('button').attr('disabled', null);
Appery('button').attr('disabled', false);
Appery('button').attr('enabled',true);
So what's the correct method?

Crystal
Posts: 0
Joined: Mon Nov 25, 2013 8:49 am

When sending phone verification code, plus some JS code judgments can not be repeated within 60 seconds to send the veri

I have looked it and tried all this method,but it does't work.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

When sending phone verification code, plus some JS code judgments can not be repeated within 60 seconds to send the veri

preAppery("mobilebutton").addClass("ui-disabled");/prewhere mobilebutton - button name. Delete another code you use to disable button.

Crystal
Posts: 0
Joined: Mon Nov 25, 2013 8:49 am

When sending phone verification code, plus some JS code judgments can not be repeated within 60 seconds to send the veri

Hello,
Appery("mobilebutton").addClass("ui-disabled"); The code is used to disable the button, while I want to do is enable the button.

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

When sending phone verification code, plus some JS code judgments can not be repeated within 60 seconds to send the veri

Hello,

To enable button:
pre
Appery("mobilebutton").removeClass("ui-disabled");
/pre

Return to “Issues”