惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
有赞技术团队
有赞技术团队
Vercel News
Vercel News
Engineering at Meta
Engineering at Meta
Hugging Face - Blog
Hugging Face - Blog
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
B
Blog RSS Feed
H
Help Net Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
V
Visual Studio Blog
B
Blog
MongoDB | Blog
MongoDB | Blog
T
The Blog of Author Tim Ferriss
L
LangChain Blog
D
Docker

博客园 - 凌寒飘香

jquery getJSON bat 结束进程 mysql 行转列 ASP.NET连接Oracle数据库的步骤详解(转) mysql event mysql安装出现error Nr.1045 (转) windows服务(installutil.exe)报错。异常来自 HRESULT:0x80131515 NSIS堆栈 Push,Pop用法详解(转) bat,copy 文件 js ,String.format gridview模板页面调用js函数 执行带out参数的存储过程sql 无线网络配置 readexcel 打印配置 无线路由设置 pmi id 查询 天龙八部,小师妹,李沧海,齐御风 Windows Server 2008开机取消必须输入密码登录系统,不要按CTRL+ALT+DEL”,
jquery.validate.min.js
凌寒飘香 · 2013-01-28 · via 博客园 - 凌寒飘香

<script language="javascript" src="http://www.cnblogs.com/Js/jquery.validate.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $.validator.addMethod('CheckCodeIsExists',function (value, element) {
            var IsExists;
            var txt = $("#<%=txtCollectorCode.ClientID%>").val();
            var originalTxt = $("#<%=hid_OriginalCode.ClientID %>").val();
            $.ajax({
                    type: "get",
                    url: "LeXinDeviceHandler.ashx?LeXinCollectorCode=" + txt ,
                    async: false,
                    success: function (data, textStatus) {

                        if(('<%=Action %>' == "NEW") ||('<%=Action %>' == "UPDATE" &&  txt!=originalTxt))
                        {
                            if (data == "true") {
                                IsExists="false"
                            }
                            else
                            {
                                IsExists="true"
                            }
                          }
                    }

                });
                if(IsExists=="false")
                    return false;
                else
                    return true;

                });

            $.validator.addMethod('CheckSelect',function (value, element) {
                return value != "-1"&&value!="";
            });

            $("#<%=btnReturn.ClientID %>").click(function () {
                location.href = "LeXinCollectorManager.aspx";
            });

             var strCode = $("#<%=txtCollectorCode.ClientID%>").val();
             $("#<%=hid_OriginalCode.ClientID %>").val(strCode);

            $("form").first().validate
            ({ 
                errorElement:"em",
                rules:
                {
                    <%=txtCollectorCode.UniqueID %>:{required:true,CheckCodeIsExists:true},
                    <%=ddlType.UniqueID%>:{CheckSelect:true}
                },
                messages:{
                    <%=txtCollectorCode.UniqueID %>:{required:'<%=Xys.Remp.Web.Resource.GetString("Remp_NotNull")%>',CheckCodeIsExists:'采集器序列号已存在'},
                    <%=ddlType.UniqueID%>:{CheckSelect:'请选择'}
                },

                errorPlacement:function(error,element){ error.appendTo(element.parent());}
            });
        });
    </script>