1. var patrn = /^\d+(\.\d+)?$/; var num = 0.11; if (!patrn.exec(num)){ alert("请您输入数字");return; }2. var patten = /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g; var num = 0.11; if(!patten.test(num)){ alert("请您输入数字");return; }…
function chk() { var patrn = /^\d+(\.\d+)?$/; var result = true; $("input[type=text]").each(function () { if (!patrn.exec(this.value)) { alert("请输入正确的数字!"); result = false; } }) return result; }…
function isPassUrl(remoteLoginUrl){ var flag = false; var passUrlStr = document.getElementById("passUrlStr").value; var urlReg = /[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62}|(:[0-9]{1,4}))+\.?/; var subUrl=urlReg.exec(remoteLog…