function IsEmpty(obj){
if(obj.value=="")
{
alert("字段不能为空。");
if(obj.disabled==false && obj.readOnly==false)
obj.focus();
}
}<form name="form1" method="post" action="">
<Input name="inputOne" type="text" class="input1" onBlur="IsEmpty(this)">
if(obj.value=="")
{
alert("字段不能为空。");
if(obj.disabled==false && obj.readOnly==false)
obj.focus();
}
}<form name="form1" method="post" action="">
<Input name="inputOne" type="text" class="input1" onBlur="IsEmpty(this)">
{
if (form.name.value==""){alert("请输入您的姓名!");form.name.focus();return;}
form.submit();}//-->
</script><input type="button" name="Button2" value=" 提交 " onClick="check(form1)">