<%@ page language="java" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%> <c:set var="ctx" value="${pageContext.request.contextPath}" /> <%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html lang="en"> <head> <title>全网监控智能分析平台</title> <style> .table-null .table{ margin-bottom: 0px; } .table-null .table > tbody > tr > td, .table-null .table > thead > tr > th{ text-align: center; width: 25%; } .table-null td:first-child{ text-align: right; width: 36%; } .table-null tr td:last-child .form-control,.table-null tr td:last-child table{ width: 400px; } </style> <script type="text/javascript" src="${ctx}/static/js/validation.js"></script> <script language="javascript"> $(document).ready(function() { }); function submitForm() { var url = '${ctx}/BaseManage/EWarningDropRuleManage/checkNameAndCode'; var data = 'name=' + $('#name').val() + "&code=" + $('#code').val() + "&ruleId=" + $('#eWarningDropRuleId').val(); if (validate()) { $.ajax({ type : 'POST', url: url, data:data, success: function(data) { if(data == '1') { alert("规则名称已存在"); $('#name').focus(); } else if (data == '2') { alert("规则代码已存在"); $('#code').focus(); } else { $('#detailForm').submit(); } } }); } } function validate() { if(!checkNameAndCode()) { return false; } if(!checkRequired()) { return false; } return true; } </script> </head> <body> <div class="col-xs-12" style="padding-top: 20px;"> <form id="detailForm" class="form-horizontal" role="form" action="${ctx}/BaseManage/EWarningDropRuleManage/submitEWarningDropRuleFrame" method="post"> <input type="hidden" name="eWarningDropRuleId" id="eWarningDropRuleId" value="${eWarningDropRule.eWarningDropRuleId}"> <table class="table-null"> <tr> <td>规则名称(<font color="red">必填</font>):</td> <td><input type="input" class="form-control" id="name" name="name" value="${eWarningDropRule.name}" maxlength="33"></td> </tr> <tr> <td>规则代码(<font color="red">必填</font>):</td> <td><input type="input" class="form-control" id="code" name="code" value="${eWarningDropRule.code}" maxlength="100"></td> </tr> <tr> <td>正常监测次(<font color="red">必填</font>):</td> <td><input type="input" class="form-control required" id="correctNums" name="correctNums" value="${eWarningDropRule.correctNums}"></td> </tr> <tr> <td></td> <td> <button type="button" id="modelSubmit" class="btn btn-primary" onclick="saveForm('eWarningDropRuleId');">确定</button> <!-- <button type="reset" class="btn btn-default" id="modelReset">清空</button> --> <button type="reset" class="btn btn-warning" id="modelBack" onclick="window.location.href='${ctx}/BaseManage/EWarningDropRuleManage/eWarningDropRuleListFrame'">返回</button> </td> </tr> </table> </form> </div> </body> </html>