这个问题不明白,请指正 程序没执行吧?跟踪一下,加个。。window.alert('球员有重复!');看看执行没? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我在每个地方加了window.alert('球员有重复!');发现完全没有执行 是不是我提交的地方有错误 调试客户端脚本的方法:http://cnblogs.com/sadier/articles/28405.aspx 1、检查大小写2、让IE显示每个脚本错误。3、alert每个a[0],a[1]的值 现在改成这样就是验证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> <form id="Form1" onsubmit="return checkSubmit();" method="post" runat="server">Form的onsubmit事件不被asp.net所支持 对头onsubmit="return checkSubmit();" 有问题 但我改成只一句话的时候却可以执行,我想是不是a[0]=document.getElementById('DropDownList1').value;的问题getElementById后面没有value属性,如何获得DropDownList1的值? 想写一个类似于DOS控制台的文本框,高手指点下 C#程序中如何防止PPC自动进入待机状态 新手提问,不要笑呀。(ifunction1)a 是强制转换吗? 【急】关于MDI中子窗口返回值的问题 关于字符串解析问题 gridview删除,怎么出现outofindex的问题啊 一道微软面试题(求解)! .net 3.5 编程疑难,请解答! DataTable取Sqlserver中Decimal类型的问题? c# 救命啊 123 在dropdownlist控件里的字符串怎样换行??
http://cnblogs.com/sadier/articles/28405.aspx
2、让IE显示每个脚本错误。
3、alert每个a[0],a[1]的值
说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>
onsubmit="return checkSubmit();" 有问题