function check(form) { if (form.name.value == "") { alert("请输入您的姓名!"); form.name.focus(); return false; } if (form.phone.value == "") { alert("请输入您的手机号!"); form.phone.focus(); return false; } return true; }