策略号唯一性验证
This commit is contained in:
@@ -23,29 +23,44 @@ $(function(){
|
|||||||
submitHandler: function(form){
|
submitHandler: function(form){
|
||||||
var flag = true;
|
var flag = true;
|
||||||
var cfgId=$("#cfgId").val();
|
var cfgId=$("#cfgId").val();
|
||||||
if($("#isAdd").val() == true){
|
var message="";
|
||||||
$.ajax({
|
if(cfgId <=100 && cfgId != 0){
|
||||||
type:'post',
|
message="策略号值只能为0,或大于100";
|
||||||
async:false,
|
flag=false;
|
||||||
url:'${ctx}/maintenance/dnsResStrategy/validCfgId',
|
}
|
||||||
data:{"cfgId":cfgId},
|
if(flag){
|
||||||
success:function(data){
|
if($("#isAdd").val() == 'true'){
|
||||||
if(data){//存在cfgId
|
$.ajax({
|
||||||
flag=false;
|
type:'post',
|
||||||
}else{
|
async:false,
|
||||||
flag=true;
|
url:'${ctx}/maintenance/dnsResStrategy/validCfgId',
|
||||||
}
|
data:{"cfgId":cfgId},
|
||||||
}
|
success:function(data){
|
||||||
|
if(data){
|
||||||
});
|
flag=false;
|
||||||
|
message="策略号已存在";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(flag){
|
||||||
|
$("#cfgId").removeClass("error");
|
||||||
|
$("#cfgId").attr("aria-invalid","false");
|
||||||
|
}else{
|
||||||
|
$("div[for=cfgId]").html("<label for=\"cfgId\" class=\"error\" id=\"cfgId-error\">"+message+"</label>");
|
||||||
|
$("#cfgId").addClass("error");
|
||||||
|
$("#cfgId").attr("aria-invalid","true");
|
||||||
}
|
}
|
||||||
if(flag){
|
if(flag){
|
||||||
form.submit();
|
form.submit();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
errorContainer: "#messageBox",
|
errorContainer: "#messageBox"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -83,7 +98,7 @@ $(function(){
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="policy_number"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="policy_number"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input class="form-control required" <c:if test="${!isAdd}" >readonly="true"</c:if> type="text" id="cfgId" name="cfgId" value="${_cfg.cfgId}">
|
<input class="form-control required number" <c:if test="${!isAdd}" >readonly="true"</c:if> type="text" id="cfgId" name="cfgId" value="${_cfg.cfgId}">
|
||||||
</div>
|
</div>
|
||||||
<div for="cfgId"></div>
|
<div for="cfgId"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user