本帖最后由 Madison612 于 2014-05-28 13:16:34 编辑

解决方案 »

  1.   

    document.getElementById("<%= rptProductList.ClientID %>") 是否获取到了元素?
      

  2.   

    应该是 <%= rptProductList.ClientID %>没有值,导致对null操作,报错了就不执行了
      

  3.   

    应该是没有获取到,生成的源文件是这样的,这里的ID应该怎么写
    <input name="ctl00$cph_Master_Content$rptProductList$ctl01$txtProduct_Count" type="text" value="1" id="ctl00_cph_Master_Content_rptProductList_ctl01_txtProduct_Count" class="txtProduct_Count" />
      

  4.   

    解决了,直接在repeater中嵌套一个table,这服务器控件真不会搞,要不是后台也要用真烦这服务器控件的ID
    function checkcount() {
                var tb = document.getElementById("tbid").getElementsByTagName("input");
                //alert(tb.length);
                for (var i = 0; i < tb.length; i++) {
                    if (tb[i].value == "" || checkint(tb[i].value) == false) { 
                        return false
                    }
                }
            return true;
        }