隐藏这个按钮

隐藏这个按钮。场景一、隐藏这个按钮。有八个输入金额的风貌,那些金额必要证实,验证表达如下:

隐藏这个按钮。隐藏这个按钮。HTML:

上述这篇巧用weui.topTips验证数据的实例便是小编分享给大家的全体内容了,希望能给我们三个参谋,也愿意我们多多照顾脚本之家。

       其它         其它金额           确定   
//验证 $.on { var value = this.value; var regChinese = new RegExp("[\\u4E00-\\u9FFF]+", "g"); //汉语 var specialSymbol =/[`~!@#$%^&*_+<>{}\/'[\]]/im; //特殊符号 //字符串不能为空 if { $.unbind; setTimeout { $.css.text; }, 500); //字符串是否为“空”字符即用户输入了空格 } else if|.length == 0) { $.unbind; setTimeout { $.css.text; }, 500); //字符串是否为空或者全部都是空格 } else if { $.unbind; setTimeout { $.css.text; }, 500); //字符串是否为汉字 } else if(regChinese.test { $.unbind; setTimeout { $.css.text; }, 500); //字符串不能为0 } else if { $.unbind; setTimeout { $.css.text; }, 500); //小于3 } else if { $.unbind; setTimeout { $.css.text; }, 500); //不能大于200 } else if > 200) { $.unbind; setTimeout { $.css.text; }, 500); } else if(specialSymbol.test{ //禁止输入特殊字符 $.unbind; setTimeout { $.css.text; }, 500); //自定义金额只能是数字 } else if(typeof { setTimeout { $.css.text; }, 500); //其它金额 $.on { var otherPrice = $; otherPrice = parseInt; otherPrice = otherPrice.toString(); console.log; var data = { userId: userId, price: otherPrice }; data = JSON.stringify; $.ajax({ data: {}, dataType: 'json', type: "post", url: postDoctorPrice().replace.replace("{price}", otherPrice), //post 时url带参数 contentType: 'application/json; charset=utf-8', success: function { if(data && data.status == '200') { weui.topTips; } }, error: function { location.href = 'doctor_wode.html'; } }); }); } })

场景二、富有违反规距的都有音讯提醒,可是“明确”开关不隐敝,只是删除它的click事件,独有切合条件的能力够跳转

唯大器晚成可以的是,只有输入3~199里边的数字,上面包车型客车分明按键才会展现,否则,遮掩这些开关。

JS:

 //&#35774;&#32622;&#20854;&#23427;&#37329;&#39069; var doctorPrices = [{ "doctorPrice": "5" }, { "doctorPrice": "10" }, { "doctorPrice": "15" }, { "doctorPrice": "20" }, { "doctorPrice": "30" }, { "doctorPrice": "60" }]; var userId = $.cookie; $ { selectedPrice; var page = $; //&#39030;&#23618;div var panel = page.find; function selectedPrice() { var $titleHtml = ''; for(var a = 0; a &lt; doctorPrices.length; a++) { var priceName = doctorPrices[a].doctorPrice; //&#28857;&#21608;weui_btn_dialog&#38544;&#34255; $titleHtml += '&lt;button ' + 'name=' + priceName + '&gt;' + priceName + '&lt;/button&gt;'; $.css; } $('.weui-jiaj-money-box-btn').append; //&#36873;&#25321;&#37329;&#39069; $.click { var titleValue = $; //$&#34920;&#31034;&#33719;&#21462;&#24403;&#21069;&#34987;&#28857;&#20987;&#20803;&#32032;&#30340;name&#20540; var data = { userId: userId, price: titleValue }; data = JSON.stringify; $.ajax({ data: {}, dataType: 'json', type: "post", url: postDoctorPrice().replace.replace("{price}", titleValue), contentType: 'application/json; charset=utf-8', success: function { if(data &amp;&amp; data.status == '200') { weui.topTips; } }, error: function { location.href = 'doctor_wode.html'; } }); }); //&#20854;&#23427;&#37329;&#39069; $.on { var otherPrice = $; otherPrice = parseInt; otherPrice = otherPrice.toString(); console.log; var data = { userId: userId, price: otherPrice }; data = JSON.stringify; $.ajax({ data: {}, dataType: 'json', type: "post", url: postDoctorPrice().replace.replace("{price}", otherPrice), //post &#26102;url&#24102;&#21442;&#25968; contentType: 'application/json; charset=utf-8', success: function { if(data &amp;&amp; data.status == '200') { weui.topTips; } }, error: function { location.href = 'doctor_wode.html'; } }); }); } //&#39564;&#35777; $.on{ var value = this.value; var regChinese = new RegExp("[\\u4E00-\\u9FFF]+","g"); //&#23383;&#31526;&#20018;&#19981;&#33021;&#20026;&#31354; if { $.hide(); weui.topTips; //&#23383;&#31526;&#20018;&#26159;&#21542;&#20026;&#8220;&#31354;&#8221;&#23383;&#31526;&#21363;&#29992;&#25143;&#36755;&#20837;&#20102;&#31354;&#26684; }else if|.length ==0){ $.hide(); weui.topTips; //&#23383;&#31526;&#20018;&#26159;&#21542;&#20026;&#31354;&#25110;&#32773;&#20840;&#37096;&#37117;&#26159;&#31354;&#26684; }else if{ $.hide(); weui.topTips; //&#23383;&#31526;&#20018;&#26159;&#21542;&#20026;&#27721;&#23383; }else if(regChinese.test{ $.hide(); weui.topTips; //&#23383;&#31526;&#20018;&#19981;&#33021;&#20026;0 }else if{ $.hide(); weui.topTips; //&#19981;&#33021;&#22823;&#20110;200 }else if &gt; 200){ $.hide(); weui.topTips; //&#33258;&#23450;&#20041;&#37329;&#39069;&#21482;&#33021;&#26159;&#25968;&#23383; }else if(typeof{ $.show 

发表评论

电子邮件地址不会被公开。 必填项已用*标注