但我用其它程序试一下却支持onsubmit啊,我想还是程序问题

解决方案 »

  1.   

    a[0]=document.getElementById('DropDownList1').value;
    --->
    a[0]=document.getElementById('DropDownList1').options[document.getElementById('DropDownList1').selectedIndex].value;
      

  2.   

    a[0]=document.getElementById('DropDownList1').options(document.getElementById('DropDownList1').selectedIndex).value;
      

  3.   

    'DropDownList1'?
    还是
    document.getElementById(' + DropDownList1.ClientID + ')
      

  4.   

    你这样做吧
    a[0]=document.all.<%= DropDownList1.ClientID %>.options(document.all.<%= DropDownList1.ClientID %>.selectedIndex).value;
      

  5.   

    function checkSubmit()
    {
       IsEqual();
       if(b==1)
       {
           return false;
       }
       else{
       return true;
       }
    }
      

  6.   

    终于有提示了,但一下子提示了7下,我想window.alert('球员有重复!');
    写错位置了,还有就是提示完后还是继续执行了修改程序,我要提示后不执行程序怎么办?
      

  7.   

    这样修改一下:
    for (j=0;j<11;j++)
       { 
            for (num=j+1 ;num<11;num++)
            { 
    if (a[j]==a[num])
    {
        b=1;
                      这个地方不alert!
                          break;
    }
                      else
                      {
                         b=0;
                      }
    }
       }
    function checkSubmit()
    {
       IsEqual();
       if(b==1)
       {  
           alert('球员有重复!');这个地方alert就可以了
           return false;
       }
       else{
       return true;
       }
    }
      

  8.   

    return false;之后应该不继续执行才对