function check(Form)
{
for (i=0;i<Form.length:i++)
{
if (Form.elements[i].value=="")
{
alert(Form.elements[i].name + "不能为空 !");
Form.elements[i].focus();
return;
}
}
Form.submit();
}
使用: < input name="Button" type="buttion" value="提交" onClick="check(form1)">