没加(),搞清楚用的那种语言三<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"><script language="javascript">
<!--
function check(){
if (IsNul(form1.text1))
window.alert ("the first is null");
else
if (isnul(form1.text2 ))
window.alert ("the second is null");
else
if (isnul(form1.text3 ))
window.alert ("the third is null");
else
return true
}
//-->
</script>
</HEAD>
<BODY bgcolor="#cccccc">
<form name="form1" action="" method="post">
<table border=1 width=500>
<tr>
<td>1</td>
<td><INPUT type="text" id=text1 name=text1></td>
</tr>
<tr>
<td>2</td>
<td><INPUT type="text" id=text2 name=text2></td>
</tr>
<tr>
<td>3</td>
<td><INPUT type="text" id=text3 name=text3></td>
</tr>
<tr>
<td><INPUT type="button" value="Submit"  name=submit1 onclick="javascript:if (check()){form1.action ='test2.asp'};"></td>
<td><INPUT type="reset" value="Reset" id=reset1 name=reset1></td>
</tr>
</table>
</form>
</BODY>
</HTML>

解决方案 »

  1.   

    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"><script language="javascript">function check(){
    if(form1.text1 == "") //here
    window.alert ("the first is null");
    else
    if(form1.text2 == "") //here
    window.alert ("the second is null");
    else
    if(form1.text3 == "") //here
    window.alert ("the third is null");
    else
    return true;
    }</script>
    </HEAD>
    <BODY bgcolor="#cccccc">
    <form name="form1" action="" method="post">
    <table border=1 width=500>
    <tr>
    <td>1</td>
    <td><INPUT type="text" id=text1 name=text1></td>
    </tr>
    <tr>
    <td>2</td>
    <td><INPUT type="text" id=text2 name=text2></td>
    </tr>
    <tr>
    <td>3</td>
    <td><INPUT type="text" id=text3 name=text3></td>
    </tr>
    <tr>
    <td><INPUT type="button" value="Submit"  name=submit1 onclick="javascript:if(check()){form1.action ='test2.asp'};"></td>
    <td><INPUT type="reset" value="Reset" id=reset1 name=reset1></td>
    </tr>
    </table>
    </form>
    </BODY>
    </HTML>
      

  2.   

    javaScript里面的if后面要跟()
      

  3.   

    加了(),也就是if (check())后还是不行!
    麻烦帮忙再看看!
    谢谢啦