表单验证优化
This commit is contained in:
@@ -8,13 +8,13 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">字典标签:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="dictLabel" id="dictLabel"/>
|
||||
<input class="form-control" type="text" name="dictLabel" id="dictLabel" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">字典键值:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="dictValue" id="dictValue"/>
|
||||
<input class="form-control" type="text" name="dictValue" id="dictValue" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -32,7 +32,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">字典排序:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="dictSort">
|
||||
<input class="form-control" type="text" name="dictSort" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -82,17 +82,11 @@
|
||||
|
||||
$("#form-dict-add").validate({
|
||||
rules:{
|
||||
dictLabel:{
|
||||
required:true,
|
||||
},
|
||||
dictValue:{
|
||||
required:true,
|
||||
},
|
||||
dictSort:{
|
||||
required:true,
|
||||
digits:true
|
||||
},
|
||||
}
|
||||
},
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
|
@@ -9,13 +9,13 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">字典标签:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="dictLabel" id="dictLabel" th:field="*{dictLabel}"/>
|
||||
<input class="form-control" type="text" name="dictLabel" id="dictLabel" th:field="*{dictLabel}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">字典键值:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="dictValue" id="dictValue" th:field="*{dictValue}"/>
|
||||
<input class="form-control" type="text" name="dictValue" id="dictValue" th:field="*{dictValue}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -33,7 +33,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">字典排序:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="dictSort" th:field="*{dictSort}">
|
||||
<input class="form-control" type="text" name="dictSort" th:field="*{dictSort}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -83,17 +83,11 @@
|
||||
|
||||
$("#form-dict-edit").validate({
|
||||
rules:{
|
||||
dictLabel:{
|
||||
required:true,
|
||||
},
|
||||
dictValue:{
|
||||
required:true,
|
||||
},
|
||||
dictSort:{
|
||||
required:true,
|
||||
digits:true
|
||||
},
|
||||
}
|
||||
},
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
|
@@ -8,13 +8,13 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">字典名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="dictName" id="dictName"/>
|
||||
<input class="form-control" type="text" name="dictName" id="dictName" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">字典类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="dictType" id="dictType">
|
||||
<input class="form-control" type="text" name="dictType" id="dictType" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -40,11 +40,7 @@
|
||||
|
||||
$("#form-dict-add").validate({
|
||||
rules:{
|
||||
dictName:{
|
||||
required:true,
|
||||
},
|
||||
dictType:{
|
||||
required:true,
|
||||
minlength: 5,
|
||||
remote: {
|
||||
url: prefix + "/checkDictTypeUnique",
|
||||
@@ -65,7 +61,8 @@
|
||||
"dictType": {
|
||||
remote: "该字典类型已经存在"
|
||||
}
|
||||
}
|
||||
},
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
|
@@ -9,13 +9,13 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">字典名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="dictName" id="dictName" th:field="*{dictName}"/>
|
||||
<input class="form-control" type="text" name="dictName" id="dictName" th:field="*{dictName}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">字典类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="dictType" id="dictType" th:field="*{dictType}">
|
||||
<input class="form-control" type="text" name="dictType" id="dictType" th:field="*{dictType}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -41,11 +41,7 @@
|
||||
|
||||
$("#form-dict-edit").validate({
|
||||
rules:{
|
||||
dictName:{
|
||||
required:true,
|
||||
},
|
||||
dictType:{
|
||||
required:true,
|
||||
minlength: 5,
|
||||
remote: {
|
||||
url: prefix + "/checkDictTypeUnique",
|
||||
@@ -69,7 +65,8 @@
|
||||
"dictType": {
|
||||
remote: "该字典类型已经存在"
|
||||
}
|
||||
}
|
||||
},
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
|
Reference in New Issue
Block a user