function CheckForm() { if(document.form1.trainingName.value==""){ alert("培训班名称不能为空!"); document.form1.trainingName.focus(); return false; } }