主题:[原创]高手请给我看下是哪出了问题
第二个文本框怎么就验证不了呢
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> 简单页面开发 </TITLE>
<script language = "JavaScript">
function text2(){
if(document.myForm.text2.value =="")
alert("第二个文本框不能为空");
}
</script>
</HEAD>
<BODY>
<CENTER>
<H1 STYLE = "font-family:'宋体' ; font-size:25pt ; font-weight:bold ">号外号外!</H1></CENTER>
<BR>
<PRE>
1.三鹿说奶站下毒
2.奶站说奶农下毒
3.奶农说奶牛下毒
4.奶牛说草下毒
5.草。。。。。。
</PRE>
<BR>
<FORM name = "myForm" ACTION = "" METHOD = "POST" >
<TABLE BORDER = "1" ALIGN = "CENTER">
<TR>
<TH>示范</TH>
<TH STYLE = "text-align:left" COLSPAN = "2">天下无贼</TH>
<TH style = "text-align:center">蜀山剑侠传</TH>
<TH style = "text-align:right">黄金甲</TH>
</TR>
<TR>
<TD style = "vertical-align:top" ROWSPAN = "2">电影</TD>
<TD><A HREF = "http://www.google.com">链接</A></TD>
<TD> <input name = "text" onChange = "if(/\D/.test(this.value)){alert('文本框一只能输入数字');this.value='' ;}"></TD>
<TD>ABC</TD>
<TD><input type = "text" name = "text2" size = "20" value = "" ></TD>
<TR>
<TD STYLE="font-style:italic;vertical-align:top">大狗斜斜地爬上来了。。。</TD>
<TD STYLE="font-weight:bold;vertical-align:top;text-align:center">黑风寨</TD>
<TD style = "font-size:27pt">大字报</TD>
<TD><IMG ALIGN = "MIDDLE" SRC = "01.GIF"></TD>
</TR>
</TR>
</TABLE>
<CENTER>
<P>
<INPUT TYPE = "SUBMIT" NAME = "BUTTON" VALUE = "提交表单" onClick = "text2()">
</P></CENTER>
</FORM>
</BODY>
</HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> 简单页面开发 </TITLE>
<script language = "JavaScript">
function text2(){
if(document.myForm.text2.value =="")
alert("第二个文本框不能为空");
}
</script>
</HEAD>
<BODY>
<CENTER>
<H1 STYLE = "font-family:'宋体' ; font-size:25pt ; font-weight:bold ">号外号外!</H1></CENTER>
<BR>
<PRE>
1.三鹿说奶站下毒
2.奶站说奶农下毒
3.奶农说奶牛下毒
4.奶牛说草下毒
5.草。。。。。。
</PRE>
<BR>
<FORM name = "myForm" ACTION = "" METHOD = "POST" >
<TABLE BORDER = "1" ALIGN = "CENTER">
<TR>
<TH>示范</TH>
<TH STYLE = "text-align:left" COLSPAN = "2">天下无贼</TH>
<TH style = "text-align:center">蜀山剑侠传</TH>
<TH style = "text-align:right">黄金甲</TH>
</TR>
<TR>
<TD style = "vertical-align:top" ROWSPAN = "2">电影</TD>
<TD><A HREF = "http://www.google.com">链接</A></TD>
<TD> <input name = "text" onChange = "if(/\D/.test(this.value)){alert('文本框一只能输入数字');this.value='' ;}"></TD>
<TD>ABC</TD>
<TD><input type = "text" name = "text2" size = "20" value = "" ></TD>
<TR>
<TD STYLE="font-style:italic;vertical-align:top">大狗斜斜地爬上来了。。。</TD>
<TD STYLE="font-weight:bold;vertical-align:top;text-align:center">黑风寨</TD>
<TD style = "font-size:27pt">大字报</TD>
<TD><IMG ALIGN = "MIDDLE" SRC = "01.GIF"></TD>
</TR>
</TR>
</TABLE>
<CENTER>
<P>
<INPUT TYPE = "SUBMIT" NAME = "BUTTON" VALUE = "提交表单" onClick = "text2()">
</P></CENTER>
</FORM>
</BODY>
</HTML>