程序没执行吧?跟踪一下,加个。。window.alert('球员有重复!');看看执行没?

解决方案 »

  1.   

    我在每个地方加了window.alert('球员有重复!');发现完全没有执行 是不是我提交的地方有错误
      

  2.   

    调试客户端脚本的方法:
    http://cnblogs.com/sadier/articles/28405.aspx
      

  3.   

    1、检查大小写
    2、让IE显示每个脚本错误。
    3、alert每个a[0],a[1]的值
      

  4.   

    现在改成这样就是验证11个DropDownList控件提交的值是否重复,虽然有重复但没有报出来
    说30行缺少; 但我检查并不缺少
    <script language="javascript">
    function checkSubmit()
    {
       if(b==1)
       {
           return false;
       }
       else{
       return true;
       }
    }
    function IsEqual()
    {
       a[0]=document.getElementById('DropDownList1').value;
       a[1]=document.getElementById('DropDownList2').value;
       a[2]=document.getElementById('DropDownList3').value;
       a[3]=document.getElementById('DropDownList4').value;
       a[4]=document.getElementById('DropDownList5').value;
       a[5]=document.getElementById('DropDownList6').value;
       a[6]=document.getElementById('DropDownList7').value;
       a[7]=document.getElementById('DropDownList8').value;
       a[8]=document.getElementById('DropDownList9').value;
       a[9]=document.getElementById('DropDownList10').value;
       a[10]=document.getElementById('DropDownList11').value;
       int b=0;
       
       for (j=0;j<11;j++)
       { 
            for (num=j+1 ;num<11;num++)
            { 
    if (a[j]==a[num])
    {
    window.alert('球员有重复!');
                          b=1;
                          break;
    }
                      else
                      {
                         b=0;
                      }
    }
       }
    }
    </script>
      

  5.   

    <form id="Form1" onsubmit="return checkSubmit();" method="post" runat="server">Form的onsubmit事件不被asp.net所支持
      

  6.   

    对头
    onsubmit="return checkSubmit();" 有问题
      

  7.   

    但我改成只一句话的时候却可以执行,我想是不是a[0]=document.getElementById('DropDownList1').value;的问题getElementById后面没有value属性,如何获得DropDownList1的值?