document.writeln('
'); function chkgbdata() { if(document.comment.content.value.length<2) { alert("请填写留言内容。"); document.comment.content.focus(); return false; } if(document.comment.mail.value.length>0 && document.comment.mail.value.indexOf("@")==-1) { alert("请正确填写电子邮件地址。"); document.comment.mail.focus(); return false; } return true; }