Line:71
Char:3
Code:0
Error:'document.form.name' 为空或不是对象
网址:http://localhost/test/123.html
以下是代码,请大家帮帮忙,问题出在哪了。我是初学者,实在是弄不明白了。
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>留言板</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<script language="javascript">
<!--
function Agree_onclick() {
if(form.Agree.checked == true)
{
form.OK.disabled = false;
}
else
{
form.OK.disabled = true;
}
}
function save(){
//if(form.name.value.Trim()=="")
//{
// alert("姓名不能为空!")
//form.name.value="";
//form.name.focus();
//return false;
//}
if(isEmptyOfName()){
alert("姓名不能为空!");
document.form.name.focus();
return false;
}
if(isEmptyOfTel()){
alert("联系电话不能为空且必须为数字!");
document.form.tel.focus();
return false;
}
//if(isEmptyOfExample()){
//alert("举证实例不能为空!");
//document.form.example.focus();
//return false;
//}
//document.form.submit();
//}
if(isEmptyOfTitle()){
alert("标题不能为空!");
document.form.title.focus();
return false;
}
if(isEmptyOfContent()){
alert("内容不能为空!");
document.form.content.focus();
return false;
}
}
function checkTel(){
if(isEmptyOfTel()){
alert("联系电话不能为空且必须为数字!");
document.form.tel.focus();
return false;
}
}
function isEmptyOfName(){
return document.form.name.value=="";
}
function isEmptyOfTel(){
return (document.form.tel.value=="" || isNaN(document.form.tel.value)==true);
}
function isEmptyOfExample(){
return document.form.example.value=="";
}
//-->
</SCRIPT>
</head>
<body>
<TABLE cellSpacing=0 cellPadding=0 width=695 border=0 align="center">
<TBODY>
<TR>
<TD> </TD></TR>
<TR>
<TD><img height=128 src="images/top.gif"
width=695 /></TD>
</TR>
<TR>
<TD vAlign=top width=695 background=images/bg.gif
height=462>
<TABLE height=459 cellSpacing=0 cellPadding=0 width="100%" border=0 align="center">
<TBODY>
<TR>
<TD width="6%"> </TD>
<TD vAlign=top align=right width="90%">
<TABLE cellSpacing=0 cellPadding=0 width="80%" border=0 align="center">
<FORM id=form action="OnlineArticleUpdate.asp" method="post">
<TBODY>
<TR>
<TD width="15%"> </TD>
<TD width="85%"> </TD></TR>
<TR>
<TD height=25><STRONG>姓名</STRONG>:</TD>
<TD><INPUT class=tx size=50 name=name> <SPAN
class=style1>*必填</SPAN></TD></TR>
<TR>
<TD height=25><STRONG>电话</STRONG>:</TD>
<TD><INPUT class=tx size=50 name="tel" > <SPAN
class=style1>*必填</SPAN></TD></TR>
<TR>
<TD height=25><STRONG>联系地址</STRONG>:</TD>
<TD><INPUT class=tx size=50 name="address"></TD></TR>
<TR>
<TD height=25><STRONG>稿件标题</STRONG>:</TD>
<TD><INPUT class=tx size=50 name="title"> <SPAN
class=style1>*必填</SPAN></TD></TR>
<TR>
<TD height=25><STRONG>稿件内容</STRONG>:</TD>
<TD> </TD></TR>
<TR>
<TD> </TD>
<TD><TEXTAREA name="content" rows=14 cols=48></TEXTAREA> <SPAN
class=style1>*必填</SPAN></TD></TR>
<TR>
<TD colSpan=2 height=25><INPUT language=javascript
οnclick="return Agree_onclick()" type=checkbox value=1
name=Agree> <STRONG>我已经注意到了下面的不付稿费说明,并同意。</STRONG></TD></TR>
<TR align=middle>
<TD colSpan=2 height=30><INPUT language=javascript disabled onClick="return save()" type=submit value=提交 name=OK></TD></TR>
<TR align=left>
<TD style="LINE-HEIGHT: 20px" colSpan=2><SPAN
class=style1>注意:新浪城市联盟赤峰站不以刊登网友来稿盈利,仅在于给网友提供一个交流、发布的平台。<U>所有来稿恕不付稿费</U>!</SPAN></TD></TR></FORM></TABLE></TD>
<TD width="4%"> </TD></TR></TABLE></TD></TR>
<TR>
<TD><IMG height=61 src="images/bottom.gif"
width=695></TD></TR></TBODY></TABLE>
<BR>
</body>
</html>