掉了一条:点取“submit"按钮后,说缺少对象

解决方案 »

  1.   

    1.fucntion
    ==>
    function2.document.MyForm.text.value;
    ==>
    document.MyForm.text1.value;3.missing two pairs of {}4. try the following:<html>
    <head>
    <script language="JavaScript">
       function check()
       {
          var MyValue=document.MyForm.text1.value;
          if(MyValue<'z'&&MyValue>'a')
          {   alert("you input:"+'MyValue');
             return true;
          }
          else
          {
             alert("please input again!");
             return false;
          }
       }   
    </script>
    </head>
    <body>
    <form name="MyForm" method="POST" onsubmit=check()>
    <h3>This is a sumbit experience:</h3>
    <p>please input a letter between a and z:</p>
    <input type="text" name="text1" value='a' size="10">
    <input type="submit">
    </form>
    </body>
    </html>
      

  2.   

    var MyValue=document.MyForm.text.value;
    =》
    var MyValue=document.MyForm.text1.value;
    改这句