edit.jsp 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <!doctype html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <%@ include file="../../common/head.jsp"%>
  8. <link rel="stylesheet" type="text/css" href="../res/js//plugins/webuploader/webuploader.css">
  9. <link rel="stylesheet" type="text/css" href="../res/css/demo/webuploader-demo.css">
  10. <script type="text/javascript" src="../res/js/plugins/webuploader/webuploader.js"></script>
  11. <script type="text/javascript" src="../res/js/plugins/webuploader/uploader.js"></script>
  12. <cs:initFile/>
  13. </head>
  14. <body>
  15. <div class="wrapper wrapper-content">
  16. <div class="row">
  17. <div class="col-sm-12">
  18. <cs:form_validate formId="editUserForm"/>
  19. <form class="form-horizontal" action="edit.cs" id="editUserForm" method="POST">
  20. <input type="hidden" value="${dcproject.id }" name="id">
  21. <div class="form-group">
  22. <label class="col-sm-3 control-label">名称:</label>
  23. <div class="col-sm-6">
  24. <input id="name" name="name" class="form-control" validate="{required:true}" value="${dcproject.name }" validateMessage="{required:'请输入名称'}" >
  25. </div>
  26. </div>
  27. <div class="form-group">
  28. <label class="col-sm-3 control-label">省:</label>
  29. <div class="col-sm-6">
  30. <select id="provinceCode" name="provinceCode" class="form-control">
  31. <option value="" >省</option>
  32. </select>
  33. <input type="hidden" id="province" value="${dcproject.province }" name="province"/>
  34. </div>
  35. </div>
  36. <div class="form-group">
  37. <label class="col-sm-3 control-label">市:</label>
  38. <div class="col-sm-6">
  39. <select id="cityCode" name="cityCode" class="form-control">
  40. <option value="" >市</option>
  41. </select>
  42. <input type="hidden" id="city" name="city" value="${dcproject.city }" />
  43. </div>
  44. </div>
  45. <div class="form-group">
  46. <label class="col-sm-3 control-label">描述:</label>
  47. <div class="col-sm-6">
  48. <textarea id="info" name="info" class="form-control" style="height: 310px;">${dcproject.info }</textarea>
  49. </div>
  50. </div>
  51. <div class="form-group">
  52. <div class="col-sm-4 col-sm-offset-3 pull-left">
  53. <button class="btn btn-default btn-dlg-close">取消</button>
  54. <button class="btn btn-primary" type="submit">提交</button>
  55. </div>
  56. </div>
  57. </form>
  58. </div>
  59. </div>
  60. </div>
  61. <script type="text/javascript">
  62. $(function(){
  63. var provinceCode='${dcproject.provinceCode }';
  64. var cityCode='${dcproject.cityCode }';
  65. $.get('<%=basePath%>area/getProvice.cs',function(data){
  66. for(var i in data){
  67. var _option = '';
  68. if(provinceCode ==data[i].code ){
  69. _option = '<option value="' + data[i].code + '" selected>' + data[i].name + '</option>';
  70. }else{
  71. _option = '<option value="' + data[i].code + '" >' + data[i].name + '</option>';
  72. }
  73. $('#provinceCode').append(_option);
  74. }
  75. });
  76. ///省
  77. $("#provinceCode").change(function(){
  78. var self = $(this);
  79. $('#cityCode').empty();
  80. var _option = '<option>请选择</option>';
  81. $('#cityCode').append(_option);
  82. $('#city').val("");
  83. $.get('<%=basePath%>area/getByParentCode.cs',{'param': self.val()}, function(data){
  84. for(var i in data){
  85. var _option = '<option value="' + data[i].code + '" >' + data[i].name + '</option>';
  86. $('#cityCode').append(_option);
  87. }
  88. });
  89. $('#province').val(self.find("option:selected").text());
  90. });
  91. ///城市
  92. $("#cityCode").change(function(){
  93. var self = $(this);
  94. $.get('<%=basePath%>area/getByParentCode.cs',{'param': self.val()}, function(data){
  95. for(var i in data){
  96. var _option = '<option value="' + data[i].code + '" >' + data[i].name + '</option>';
  97. $('#countyCode').append(_option);
  98. }
  99. });
  100. $('#city').val(self.find("option:selected").text());
  101. });
  102. if(cityCode != ''){
  103. $.get('<%=basePath%>area/getByParentCode.cs',{'param': provinceCode}, function(data){
  104. for(var i in data){
  105. var _option = '';
  106. if(cityCode == data[i].code ){
  107. _option = '<option value="' + data[i].code + '" selected>' + data[i].name + '</option>';
  108. }else{
  109. _option = '<option value="' + data[i].code + '" >' + data[i].name + '</option>';
  110. }
  111. $('#cityCode').append(_option);
  112. }
  113. });
  114. }
  115. });
  116. </script>
  117. </body>
  118. </html>