123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <%@ page contentType="text/html;charset=UTF-8" %>
- <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
- <html>
- <head>
- <title>热搜词管理</title>
- <meta name="decorator" content="default"/>
- <style>
- .jumpType{
- margin-left: 20px;
- width: 400px;
- }
- .productList{
- margin-left: 20px;
- }
- </style>
- <script type="text/javascript">
- $(document).ready(function() {
- //$("#name").focus();
- $("#inputForm").validate({
- submitHandler: function(form){
- loading('正在提交,请稍等...');
- form.submit();
- },
- errorContainer: "#messageBox",
- errorPlacement: function(error, element) {
- $("#messageBox").text("输入有误,请先更正。");
- if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
- error.appendTo(element.parent().parent());
- } else {
- error.insertAfter(element);
- }
- }
- });
- });
- </script>
- </head>
- <body>
- <ul class="nav nav-tabs">
- <li><a href="${ctx}/baike/cmBaikeHotSearch/">热搜词列表</a></li>
- <li class="active"><a href="${ctx}/baike/cmBaikeHotSearch/form?id=${cmBaikeHotSearch.id}">热搜词${not empty cmBaikeHotSearch.id?'编辑':'添加'}</a></li>
- </ul><br/>
- <form:form id="inputForm" modelAttribute="cmBaikeHotSearch" action="${ctx}/baike/cmBaikeHotSearch/save" method="post" class="form-horizontal">
- <form:hidden path="id"/>
- <sys:message content="${message}"/>
- <div class="control-group">
- <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>热搜词:</label>
- <div class="controls">
- <form:input path="keyWord" htmlEscape="false" maxlength="15" class="input-xlarge required"/>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>跳转方式:</label>
- <div class="controls">
- <form:radiobutton path="jumpType" name="jumpType" value="1" label="仅搜索" checked="true" onclick="changeJumpType()"/>
- <%-- <br> <br>--%>
- <%-- <form:radiobutton path="jumpType" name="jumpType" value="2" label="产品" onclick="changeJumpType()"/>--%>
- <%-- <form:select path="productId" class="input-xlarge productList">--%>
- <%-- <form:option value="" label="请选择"/>--%>
- <%-- <form:options items="${productList}" itemLabel="name" itemValue="id" htmlEscape="false"/>--%>
- <%-- </form:select>--%>
- <%-- <br> <br>--%>
- <%-- <form:radiobutton path="jumpType" name="jumpType" value="3" label="仪器" onclick="changeJumpType()"/>--%>
- <%-- <form:select path="instrumentId" class="input-xlarge productList">--%>
- <%-- <form:option value="" label="请选择"/>--%>
- <%-- <form:options items="${instrumentList}" itemLabel="name" itemValue="id" htmlEscape="false"/>--%>
- <%-- </form:select>--%>
- <br> <br>
- <form:radiobutton path="jumpType" name="jumpType" value="4" label="链接" onclick="changeJumpType()"/>
- <form:input path="jumpLink" htmlEscape="false" class="input-xlarge jumpType"/>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>排序:</label>
- <div class="controls">
- <form:input path="sort" htmlEscape="false" class="input-xlarge digits required"/>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label">状态:</label>
- <div class="controls">
- <form:select path="status" class="input-xlarge required">
- <form:option value="1" label="启用"/>
- <form:option value="0" label="停用"/>
- </form:select>
- </div>
- </div>
- <div class="form-actions">
- <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
- <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
- </div>
- </form:form>
- <script>
- $(function () {
- changeJumpType()
- });
- function changeJumpType() {
- debugger
- var jumpType = $("input[name='jumpType']:checked").val();
- var productId = $("#productId");
- var instrumentId = $("#instrumentId");
- var jumpLink = $("#jumpLink");
- if (jumpType == 2) {
- productId.addClass("required");
- instrumentId.removeClass("required");
- jumpLink.removeClass("required");
- } else if (jumpType == 3) {
- productId.removeClass("required");
- instrumentId.addClass("required");
- jumpLink.removeClass("required");
- } else if (jumpType == 4){
- productId.removeClass("required");
- instrumentId.removeClass("required");
- jumpLink.addClass("required");
- } else {
- productId.removeClass("required");
- instrumentId.removeClass("required");
- jumpLink.removeClass("required");
- }
- }
- </script>
- </body>
- </html>
|