function validateForm()
{
if (document.myform.proname.value=="")
{
alert("名称没有填写!")
document.form.proname.focus();
return false;
}
return true;
}
{
if (document.myform.proname.value=="")
{
alert("名称没有填写!")
document.form.proname.focus();
return false;
}
return true;
}
{
if (document.myform.proname.value=="")
{
alert("名称没有填写!")
document.myform.proname.focus(); //这里是myform,不是form
return false;
}
return true;
}
======>
document.myform.proname.focus();
<script>
function validateForm()
{
if (document.myform.proname.value=="")
{
alert("名称没有填写!")
document.myform.proname.focus();
return false;
}
return true;
}
</script>
<form
action="product_addsave.asp"
method="post"
name="myform"
id="myform"
onSubmit="return validateForm()">
<input type="text" name="proname"></input>
<input type="submit" name="submit"></input>
</form>
<textarea name="content" style="display:none"></textarea>
<iframe ID="eWebEditor1" src="../webedit/ewebeditor.asp?id=content&style=news_system&originalfilename=originalfilename&savefilename=savefilename&savepathfilename=savepathfilename" frameborder="0" scrolling="no" width="550" HEIGHT="350"></iframe> 去掉 ,验证可以成功