摘要: View Code 1 <asp:TextBox ID="tbP_newYear" MaxLength="3" runat="server" onkeyup="this.value=this.value.replace(/\D/g,'')"2 onafterpaste="this.value=this.value.replace(/\D/g,'')"></asp:TextBox> 阅读全文
posted @ 2012-02-08 17:36 志誠 阅读(220) 评论(0) 推荐(0) 编辑
摘要: View Code 1 function checkEmail() { 2 var checp = document.getElementById("ctl00_ContentPlaceHolder1_txtP_EMAIL").value; 3 var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/; 4 if (checp != "") { 5 ... 阅读全文
posted @ 2012-02-08 16:28 志誠 阅读(180) 评论(1) 推荐(0) 编辑
摘要: View Code 1 function strlen(str) {2 var len;3 var i;4 len = 0;5 for (i = 0; i < str.length; i++) {6 if (str.charCodeAt(i) > 255) len += 2; else len++;7 }8 return len;9 } 阅读全文
posted @ 2012-02-08 16:21 志誠 阅读(148) 评论(0) 推荐(0) 编辑