[代码] [JavaScript]代码
01 | <script type = "text/javascript" src = "jquery.js" ></script> |
02 | <script type= "text/javascript" > |
03 | function checkCorpID() //检测客户编号是否可用 |
04 | { |
05 | if ($.trim($( "#txtF_CORPID" )[0].value)== "" ) //txtF_CORPID是客户编号输入框 |
06 | { |
07 | alert( "请输入客户编号!" ); |
08 | } |
09 | else |
10 | { |
11 | $( "#checkFlag" ).html( "正在检测" ); //显示提示信息 |
12 | $.ajax({ |
13 | type: "get" , |
14 | url: "CheckCorpID.ashx" , |
15 | data: "ID=" +$.trim($( "#txtF_CORPID" )[0].value), //提交表单,相当CheckCorpID.ashx?ID=XXX |
16 | success: function (msg){$( "#checkFlag" ).html( "" );alert( msg ); } //操作成功后的操作!msg是后台传过来的值 |
17 | }); |
18 | } |
19 | } |
20 | </script> |
[代码] [ASP/Basic]代码
01 | if(context.Request.Params[ "ID" ].ToString()!= "" ) |
02 | { |
03 | Pxt.Logic.SYS.CORP_BASE_INFO cbiL = new Pxt.Logic.SYS.CORP_BASE_INFO(); |
04 | bool flag=cbiL.checkCorpID(context.Request.Params[ "ID" ].ToString()); |
05 | if (flag) |
06 | { |
07 | context.Response.Write( "该客户编号已被占用!" ); |
08 | } |
09 | else |
10 | { |
11 | context.Response.Write( "该客户编号可用!" ); |
12 | } |
13 | } |