日期:2014-05-16 浏览次数:20343 次
var email = $("#email").val(); var normalMail = new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/g); if(!normalMail.test(email)){ alert("邮箱地址格式不正确"); return false; }
var emails = $("#emails").val(); var emailsArr = emails.split(","); for(var i = 0; i < emailsArr.length; i++){ var normalMail = new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/g); if(!normalMail.test(emailsArr[i])){ $(".errorSummary").text(cur_mail+"邮箱地址格式不正确!").show(); return false; } }
var _reTimeReg = /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1])) (?:(?:[0-2][0-3])|(?:[0-1][0-9])):[0-5][0-9]:[0-5][0-9]$/; if(!_reTimeReg.test(visit_time)){ alert("请使用日历控件,输入格式正确的日期时间!"); return false; }