cmBaikeHotSearchForm.jsp 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
  3. <html>
  4. <head>
  5. <title>热搜词管理</title>
  6. <meta name="decorator" content="default"/>
  7. <style>
  8. .jumpType{
  9. margin-left: 20px;
  10. width: 400px;
  11. }
  12. .productList{
  13. margin-left: 20px;
  14. }
  15. </style>
  16. <script type="text/javascript">
  17. $(document).ready(function() {
  18. //$("#name").focus();
  19. $("#inputForm").validate({
  20. submitHandler: function(form){
  21. loading('正在提交,请稍等...');
  22. form.submit();
  23. },
  24. errorContainer: "#messageBox",
  25. errorPlacement: function(error, element) {
  26. $("#messageBox").text("输入有误,请先更正。");
  27. if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
  28. error.appendTo(element.parent().parent());
  29. } else {
  30. error.insertAfter(element);
  31. }
  32. }
  33. });
  34. });
  35. </script>
  36. </head>
  37. <body>
  38. <ul class="nav nav-tabs">
  39. <li><a href="${ctx}/baike/cmBaikeHotSearch/">热搜词列表</a></li>
  40. <li class="active"><a href="${ctx}/baike/cmBaikeHotSearch/form?id=${cmBaikeHotSearch.id}">热搜词${not empty cmBaikeHotSearch.id?'编辑':'添加'}</a></li>
  41. </ul><br/>
  42. <form:form id="inputForm" modelAttribute="cmBaikeHotSearch" action="${ctx}/baike/cmBaikeHotSearch/save" method="post" class="form-horizontal">
  43. <form:hidden path="id"/>
  44. <sys:message content="${message}"/>
  45. <div class="control-group">
  46. <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>热搜词:</label>
  47. <div class="controls">
  48. <form:input path="keyWord" htmlEscape="false" maxlength="15" class="input-xlarge required"/>
  49. </div>
  50. </div>
  51. <div class="control-group">
  52. <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>跳转方式:</label>
  53. <div class="controls">
  54. <form:radiobutton path="jumpType" name="jumpType" value="1" label="仅搜索" checked="true" onclick="changeJumpType()"/>
  55. <%-- <br> <br>--%>
  56. <%-- <form:radiobutton path="jumpType" name="jumpType" value="2" label="产品" onclick="changeJumpType()"/>--%>
  57. <%-- <form:select path="productId" class="input-xlarge productList">--%>
  58. <%-- <form:option value="" label="请选择"/>--%>
  59. <%-- <form:options items="${productList}" itemLabel="name" itemValue="id" htmlEscape="false"/>--%>
  60. <%-- </form:select>--%>
  61. <%-- <br> <br>--%>
  62. <%-- <form:radiobutton path="jumpType" name="jumpType" value="3" label="仪器" onclick="changeJumpType()"/>--%>
  63. <%-- <form:select path="instrumentId" class="input-xlarge productList">--%>
  64. <%-- <form:option value="" label="请选择"/>--%>
  65. <%-- <form:options items="${instrumentList}" itemLabel="name" itemValue="id" htmlEscape="false"/>--%>
  66. <%-- </form:select>--%>
  67. <br> <br>
  68. <form:radiobutton path="jumpType" name="jumpType" value="4" label="链接" onclick="changeJumpType()"/>
  69. <form:input path="jumpLink" htmlEscape="false" class="input-xlarge jumpType"/>
  70. </div>
  71. </div>
  72. <div class="control-group">
  73. <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>排序:</label>
  74. <div class="controls">
  75. <form:input path="sort" htmlEscape="false" class="input-xlarge digits required"/>
  76. </div>
  77. </div>
  78. <div class="control-group">
  79. <label class="control-label">状态:</label>
  80. <div class="controls">
  81. <form:select path="status" class="input-xlarge required">
  82. <form:option value="1" label="启用"/>
  83. <form:option value="0" label="停用"/>
  84. </form:select>
  85. </div>
  86. </div>
  87. <div class="form-actions">
  88. <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
  89. <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
  90. </div>
  91. </form:form>
  92. <script>
  93. $(function () {
  94. changeJumpType()
  95. });
  96. function changeJumpType() {
  97. debugger
  98. var jumpType = $("input[name='jumpType']:checked").val();
  99. var productId = $("#productId");
  100. var instrumentId = $("#instrumentId");
  101. var jumpLink = $("#jumpLink");
  102. if (jumpType == 2) {
  103. productId.addClass("required");
  104. instrumentId.removeClass("required");
  105. jumpLink.removeClass("required");
  106. } else if (jumpType == 3) {
  107. productId.removeClass("required");
  108. instrumentId.addClass("required");
  109. jumpLink.removeClass("required");
  110. } else if (jumpType == 4){
  111. productId.removeClass("required");
  112. instrumentId.removeClass("required");
  113. jumpLink.addClass("required");
  114. } else {
  115. productId.removeClass("required");
  116. instrumentId.removeClass("required");
  117. jumpLink.removeClass("required");
  118. }
  119. }
  120. </script>
  121. </body>
  122. </html>