表单验证优化
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() {
|
||||
|
Reference in New Issue
Block a user