添加表单提交时验证结果,防止firefox在校验不通过时仍能提交的现象
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
<script type="text/javascript" src="${ctxStatic}/pages/scripts/specificServiceForm/specificServiceFormCfg.js"></script>
|
||||
<title></title>
|
||||
<script type="text/javascript">
|
||||
var validateForm;
|
||||
$(document).ready(function() {
|
||||
jQuery.validator.addMethod("maxValue", function(value, element) {
|
||||
return value >=0&&value<2100000000;
|
||||
@@ -41,7 +42,7 @@
|
||||
},"该配置包含下级配置,不得改为叶子节点");
|
||||
|
||||
$("#name").focus();
|
||||
$("#inputForm").validate({
|
||||
validateForm = $("#inputForm").validate({
|
||||
rules:{
|
||||
specServiceId:{
|
||||
required:true,
|
||||
@@ -91,7 +92,7 @@
|
||||
},
|
||||
|
||||
submitHandler: function(form){
|
||||
if(!validateItem()) {
|
||||
if(!validateForm.form()) {
|
||||
return false;
|
||||
}
|
||||
loading('正在提交,请稍等...');
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
<div class="form-group">
|
||||
<label><spring:message code="operate_time"/>:</label>
|
||||
<input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value="${specificServiceCfg.beginDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
|
||||
value="<fmt:formatDate value="${specificServiceCfg.beginDate}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -222,7 +222,7 @@
|
||||
<div class="form-group">
|
||||
<label> </label>
|
||||
<input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value="${specificServiceCfg.endDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
|
||||
value="<fmt:formatDate value="${specificServiceCfg.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<script type="text/javascript" src="${ctxStatic}/pages/scripts/dict.js"></script>
|
||||
<title></title>
|
||||
<script type="text/javascript">
|
||||
var validateForm;
|
||||
function selectP(){
|
||||
$("label[for='specServiceId']").hide();
|
||||
}
|
||||
@@ -75,7 +76,7 @@ function selectP(){
|
||||
return true;
|
||||
}, "请填写正确的数值");
|
||||
$("#name").focus();
|
||||
$("#inputForm")
|
||||
validateForm = $("#inputForm")
|
||||
.validate(
|
||||
{
|
||||
rules : {
|
||||
@@ -178,7 +179,7 @@ function selectP(){
|
||||
},
|
||||
|
||||
submitHandler : function(form) {
|
||||
if (!validateItem()) {
|
||||
if (!validateForm.form()) {
|
||||
return false;
|
||||
}
|
||||
loading('正在提交,请稍等...');
|
||||
|
||||
Reference in New Issue
Block a user