Instance code record:
<Script type = "text/javascript"> function start_sms_button (obj) {var count = 1; var sum = 30; var I = setInterval (function () {if (count> 10) {obj. attr ('Disabled ', false); obj. val ('send Verification Code '); clearInterval (I);} else {obj. val ('left' + parseInt (sum-count) + 'second');} count ++ ;}, 1000) ;}$ (function () {// send the verification code $ ('# send_sms '). click (function () {var phone_obj = $ ('input [name = "phone"] '); var send_obj = $ ('input # send _ Sms '); var val = phone_obj.val (); if (val) {if (IsMobile (val) {send_obj.attr ('Disabled', "disabled "); // after 30 seconds, restart the send button start_sms_button (send_obj); $. ajax ({url: '{# url_reset ("index/sms") #}', data: {'mobile': val}, dataType: 'json', type: 'post', beforeSend: function () {show_loading_body () ;}, complete: function () {show_loading_body () ;}, success: function (data) {if (data. status! = Undefined & (data. status = 'OK' | data. status = 'error') {showMsg (data. msg) ;}}) ;}else {showMsg ("Incorrect Mobile Phone Number Format ");}} else {showMsg ('mobile phone number cannot be blank ') ;}}) ;}); </script>