<script language="javascript">
function onC()
{
if(document.all.111.value=="")
{
alert("111");
return false;
}
}

解决方案 »

  1.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head><body>
    <form action="Image1.htm" method="post" onSubmit="onC()">
    <input name="111" id="111" type="text">
    <input name="333" id="333" type="submit">
    </form>
    </body>
    </html>
    <script language="javascript">
    function onC()
    {
    if(111.value=="")
    {
    alert("111");
    return false;
    }
    }
    </script>
      

  2.   

    onSubmit="onC()"这里少了一个returnonSubmit="return coC()"