zoukankan      html  css  js  c++  java
  • JS判断Gridview

     function chkDetailValid() {
                var gv = document.getElementById("gvDetail");
                for (var i = 0; i < gv.rows.length; i++) {
                    var txtAC = gv.rows[i].cells[7].getElementsByTagName("input")[0];
                    var txtLoc = gv.rows[i].cells[8].getElementsByTagName("input")[0];
                    var txtDept = gv.rows[i].cells[9].getElementsByTagName("input")[0];
                    if (txtAC != null) {
                        if (txtAC.value == '') {
                            alert("<%=localize.lblCOA + localize.IsNotAllowNull%>"); //会计科目代码不能为空。
                            txtAC.focus();
                            return false;
                        }
                    }

                    if (txtLoc != null) {
                        if (txtLoc.value == '') {
                            alert($("#lblLocationTitle").html() + "<%=localize.IsNotAllowNull %>"); //不能为空。
                            txtLoc.focus();
                            return false;
                        }
                    }

                    if (txtDept != null) {
                        if (txtDept.value == '') {
                            alert($("#lblDeptTitle").html() + "<%=localize.IsNotAllowNull %>"); //不能为空。
                            txtDept.focus();
                            return false;
                        }
                    }
                    var vatInvoice = obj.value;
                    if (vatInvoice != '')
                        var xmlURL = "JsonData.ashx?t=IV&val=" + vatInvoice;
                    $.get(xmlURL, {}, function(result) {
                        if (result == "N") {
                            alert("<%= localize.lblVatInvoice + localize.IsExists%>"); //發票號碼已經存在。
                            obj.value = '';
                            obj.focus();
                            return false;
                        }
                    }, "text");
                }

                return true;
            }

  • 相关阅读:
    xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
    xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
    xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
    xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
    2万元小投资冷门暴利行业有哪些?投资什么利润大?
    街边小投资冷门暴利行业有哪些?做什么生意利润高?
    高利润赚钱行业有哪些?300的利润使人疯狂
    大学生兼职托管干什么?大学生兼职平台有哪些?
    大学生兼职可以做什么?具体有哪些兼职可做?
    大学生兼职创业怎么做?具体做什么好?
  • 原文地址:https://www.cnblogs.com/Chinarain/p/3914044.html
Copyright © 2011-2022 走看看