function RQcheck(RQ) { var date = RQ; //(-|/)分隔符 var result = date.match(/^(d{1,4})(-|/)(d{1,2})2(d{1,2})$/); if (result == null) return false; var d = new Date(result[1], result[3] - 1, result[4]); return (d.getFullYear() == result[1] && (d.getMonth() + 1) == result[3] && d.getDate() == result[4]); } function CheckAdd() { var ret = true; if (!RQcheck($id("txt_LLRQ").value)) { alert("请输入正确的日期"); return false; } return ret; }