复选框校验
This commit is contained in:
parent
ec73e474ce
commit
c932e42a62
|
|
@ -665,9 +665,9 @@
|
|||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label is-required">客户必填信息:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="col-sm-8" id="checkboxuser">
|
||||
<label class="checkbox-inline">
|
||||
<input type="checkbox" name="actPageConfigUserinfo-userName" id="name"
|
||||
<input type="checkbox" name="actPageConfigUserinfo-userName" id="name" checked
|
||||
onclick="updateText(this)">姓名</input>
|
||||
</label>
|
||||
<label class="checkbox-inline">
|
||||
|
|
@ -726,7 +726,7 @@
|
|||
|
||||
<div class="drawText3Pri">
|
||||
<div>
|
||||
<input class="inputimg" placeholder="姓名" type="hidden" id="namePri">
|
||||
<input class="inputimg" placeholder="姓名" id="namePri">
|
||||
</div>
|
||||
<div>
|
||||
<input class="inputimg" placeholder="手机号" type="hidden" id="phonePri">
|
||||
|
|
@ -1163,13 +1163,20 @@
|
|||
|
||||
|
||||
function updateText(val) {
|
||||
|
||||
var id = val.id;
|
||||
var boolean = $("#" + id).prop("checked");
|
||||
if (boolean) {
|
||||
$("#" + id + "Pri").attr('type', 'text');
|
||||
} else {
|
||||
$("#" + id + "Pri").attr('type', 'hidden');
|
||||
console.log($("#checkboxuser").find("input:checked"));
|
||||
var length = $("#checkboxuser").find("input:checked").length;
|
||||
if (length < 1){
|
||||
//只有一个,不可以进行修改
|
||||
val.checked = !val.checked;
|
||||
$.modal.msgError("至少选中一个");
|
||||
}else{
|
||||
var id = val.id;
|
||||
var boolean = $("#" + id).prop("checked");
|
||||
if (boolean) {
|
||||
$("#" + id + "Pri").attr('type', 'text');
|
||||
} else {
|
||||
$("#" + id + "Pri").attr('type', 'hidden');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -680,7 +680,7 @@
|
|||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label is-required">客户必填信息:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="col-sm-8" id="checkboxuser">
|
||||
<label class="checkbox-inline">
|
||||
<input type="checkbox" name="actPageConfigUserinfo-userName" id="name"
|
||||
onclick="updateText(this)" th:checked="*{actPageConfigUserinfo.userName == 'on' ? true : false}" >姓名</input>
|
||||
|
|
@ -1298,13 +1298,20 @@
|
|||
|
||||
|
||||
function updateText(val) {
|
||||
|
||||
var id = val.id;
|
||||
var boolean = $("#" + id).prop("checked");
|
||||
if (boolean) {
|
||||
$("#" + id + "Pri").attr('type', 'text');
|
||||
} else {
|
||||
$("#" + id + "Pri").attr('type', 'hidden');
|
||||
console.log($("#checkboxuser").find("input:checked"));
|
||||
var length = $("#checkboxuser").find("input:checked").length;
|
||||
if (length < 1){
|
||||
//只有一个,不可以进行修改
|
||||
val.checked = !val.checked;
|
||||
$.modal.msgError("至少选中一个");
|
||||
}else{
|
||||
var id = val.id;
|
||||
var boolean = $("#" + id).prop("checked");
|
||||
if (boolean) {
|
||||
$("#" + id + "Pri").attr('type', 'text');
|
||||
} else {
|
||||
$("#" + id + "Pri").attr('type', 'hidden');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue