if (this.checked == true)
==>
if (name1.checked == true)

解决方案 »

  1.   

    还是不行,对不起,刚才程序可能没写全:
    <html>
    <head><title>输入区</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head><body onkeydown="KeyDown()"
     oncontextmenu="event.returnValue=false" leftmargin=5 topmargin=2 marginwidth=5 marginheight=2 bgcolor=eeeeee >
    <script language="Javascript"><!--
    function onscorll(){
      if(document.submitform.name1.Checked==true){
        alert('yes');
      }else{
        alert('no');
      }
    }// --></script>
    <form action="send" name=submitform target="temp" method="post" >
      <table width="100%" border="0" cellspacing="2" >
        <tr>
          <td>test</td>
        </tr>
        <tr>
          <td nowrap class=p1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;name<input type="checkbox"  name="name1" value="ON" Checked=true onClick="javascript:onscorll()">&nbsp;        </td>
        </tr>
      </table>
    </form>
    <p> </p>
    </body>
    请大侠帮忙
      

  2.   

    <html>
    <head><title>输入区</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head><body onkeydown="KeyDown()"
     oncontextmenu="event.returnValue=false" leftmargin=5 topmargin=2 marginwidth=5 marginheight=2 bgcolor=eeeeee >
    <script language="Javascript"><!--
    function onscorll(){
      if(document.submitform.name1.Checked==true){
        alert('yes');
    document.submitform.name1.Checked=false;
      }else{
        alert('no');
    document.submitform.name1.Checked=true;
      }
    }// --></script>
    <form action="send" name=submitform target="temp" method="post" >
      <table width="100%" border="0" cellspacing="2" >
        <tr>
          <td>test</td>
        </tr>
        <tr>
          <td nowrap class=p1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;name<input type="checkbox"  name="name1" value="ON" Checked=true onClick="javascript:onscorll()">&nbsp;        </td>
        </tr>
      </table>
    </form>
    <p> </p>
    </body>
      

  3.   

    if(document.submitform.name1.Checked==true){-------->if(document.submitform.name1.checked==true){
      

  4.   

    <HEAD>
    <SCRIPT>
    function checkthis()
    {
        if (name1.checked)
        {
            alert("yes");
        }else{
            alert("no");
        }
    }
    </SCRIPT> 
    </HEAD>
    <BODY>
    Check here if you wish to go to Microsoft:
    <INPUT TYPE=checkbox name="name1" value="ON"onClick="checkthis()">
    </BODY>