808175181e58ca2d0989cff2163c3482d598ab42.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%
  3. String path = request.getContextPath();
  4. %>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  9. <title>综合表单</title>
  10. <!--分离模式框架必需start-->
  11. <script type="text/javascript" src="<%=path%>/libs/js/jquery.js"></script>
  12. <script type="text/javascript" src="<%=path%>/libs/js/language/cn.js"></script>
  13. <script type="text/javascript" src="<%=path%>/libs/js/framework.js"></script>
  14. <link href="<%=path%>/libs/css/import_basic.css" rel="stylesheet" type="text/css" id="theme" themeColor="blue"/>
  15. <link rel="stylesheet" type="text/css" id="skin" prePath="<%=path%>/" splitMode="true" href="<%=path%>/libs/skins/blue/style.css"/>
  16. <link rel="stylesheet" type="text/css" id="customSkin" href="<%=path%>/system/layout/skin/style.css"/>
  17. <!--分离模式框架必需end-->
  18. <!--引入弹窗组件start-->
  19. <script type="text/javascript" src="<%=path%>/libs/js/popup/drag.js"></script>
  20. <script type="text/javascript" src="<%=path%>/libs/js/popup/dialog.js"></script>
  21. <!--引入弹窗组件end-->
  22. <!-- 树组件start -->
  23. <script type="text/javascript" src="<%=path%>/libs/js/tree/ztree/ztree.js"></script>
  24. <link type="text/css" rel="stylesheet" href="<%=path%>/libs/js/tree/ztree/ztree.css"></link>
  25. <!-- 树组件end -->
  26. <!-- 树形下拉框start -->
  27. <script type="text/javascript" src="<%=path%>/libs/js/form/selectTree.js"></script>
  28. <!-- 树形下拉框end -->
  29. <!--自动提示框start-->
  30. <script type='text/javascript' src='<%=path%>/libs/js/form/suggestion.js'></script>
  31. <!--自动提示框end-->
  32. <!-- 日期选择框start -->
  33. <script type="text/javascript" src="<%=path%>/libs/js/form/datePicker/WdatePicker.js"></script>
  34. <!-- 日期选择框end -->
  35. <!-- 双向选择器start -->
  36. <script type="text/javascript" src="<%=path%>/libs/js/form/lister.js"></script>
  37. <!-- 双向选择器end -->
  38. <!-- 树形双选器start -->
  39. <script type="text/javascript" src="<%=path%>/libs/js/form/listerTree.js"></script>
  40. <!-- 树形双选器end -->
  41. <!-- 条件过滤器 start -->
  42. <script type="text/javascript" src="<%=path%>/libs/js/form/filter.js"></script>
  43. <!-- 条件过滤器 end -->
  44. <!-- 颜色选择器start -->
  45. <script type="text/javascript" src="<%=path%>/libs/js/form/color.js"></script>
  46. <!-- 颜色选择器start -->
  47. <!-- 数字步进器start -->
  48. <script type="text/javascript" src="<%=path%>/libs/js/form/stepper.js"></script>
  49. <!-- 数字步进器end -->
  50. <!-- 软键盘控件start -->
  51. <script type="text/javascript" src="<%=path%>/libs/js/form/keypad.js"></script>
  52. <!-- 软键盘控件start -->
  53. <!-- 评星级控件start -->
  54. <script type="text/javascript" src="<%=path%>/libs/js/form/rating.js"></script>
  55. <!-- 评星级控件end -->
  56. <!-- 异步上传控件start -->
  57. <script type="text/javascript" src="<%=path%>/libs/js/form/upload/fileUpload.js"></script>
  58. <script type="text/javascript" src="<%=path%>/libs/js/form/upload/handlers.js"></script>
  59. <!--异步上传控件end -->
  60. <!-- 表单验证start -->
  61. <script src="<%=path%>/libs/js/form/validationRule.js" type="text/javascript"></script>
  62. <script src="<%=path%>/libs/js/form/validation.js" type="text/javascript"></script>
  63. <!-- 表单验证end -->
  64. </head>
  65. <body>
  66. <div id="scrollContent">
  67. <form id="form1" failAlert="表单填写不正确,请按要求填写!">
  68. <table class="tableStyle" formMode="line">
  69. <tr>
  70. <th colspan="4">表单填写</th>
  71. </tr>
  72. <tr>
  73. <td width="15%">用户名:</td><td><input type="text" class="validate[required,custom[noSpecialCaracters]]" watermark="请输入英文或数字"/><span class="star">*</span></td>
  74. <td width="15%">姓名:</td><td><input type="text" class="validate[required,custom[chinese],length[0,20]]" watermark="请输入中文"/><span class="star">*</span></td>
  75. </tr>
  76. <tr>
  77. <td>密码:</td><td><input type="password" id="pwd" class="validate[required,length[6,11],custom[noSpecialCaracters]]"/><span class="star">*</span> </td>
  78. <td>密码确认:</td><td><input type="password" class="validate[required,confirm[pwd]]"/><span class="star">*</span></td>
  79. </tr>
  80. <tr>
  81. <td>爱好:</td><td>
  82. <div id="hobby" style="width:120px;"><input type="checkbox" id="checkbox-1" class="validate[minCheckbox[1]] checkbox" name="ck1" value="选项1"/><label for="checkbox-1" class="hand">唱歌</label>
  83. <input type="checkbox" id="checkbox-2" class="validate[minCheckbox[1]] checkbox" name="ck1" value="选项2" /><label for="checkbox-2" class="hand">跳舞</label> <span class="star">*</span></div>
  84. </td>
  85. <td>性别:</td>
  86. <td><div style="width:120px;"><input type="radio" class="validate[required] radio" id="radio-1" name="ra" value="radio-1" /><label for="radio-1" class="hand">男</label>
  87. <input type="radio" id="radio-2" name="ra" class="validate[required] radio" value="radio-2"/><label for="radio-2" class="hand">女</label> <span class="star">*</span></div>
  88. </td>
  89. </tr>
  90. <tr>
  91. <td>年龄:</td><td><input type="text" watermark="请输入数字" class="validate[required,custom[onlyNumber],length[0,3]]"/><span class="star">*</span></td>
  92. <td>电子邮件:</td>
  93. <td>
  94. <input type="text" class="validate[required,custom[email]]"/><span class="star">*</span>
  95. </td>
  96. </tr>
  97. <tr>
  98. <td>固定电话:</td><td><input type="text" class=" validate[required,custom[telephone]]"/><span class="star">*</span></td>
  99. <td>英文名:</td><td><input type="text" class="validate[required,custom[onlyLetter]]"/><span class="star">*</span></td>
  100. </tr>
  101. <tr>
  102. <td>手机号码:</td><td><input type="text" class=" validate[required,custom[mobilephone]]"/><span class="star">*</span></td>
  103. <td>邮政编码:</td><td><input type="text" class=" validate[required,custom[zipcode]]"/><span class="star">*</span></td>
  104. </tr>
  105. <tr>
  106. <td>QQ:</td><td><input type="text" class=" validate[required,custom[qq]]"/><span class="star">*</span></td>
  107. <td>非法字符:</td>
  108. <td>
  109. <input type="text" class=" validate[required,custom[illegalLetter]]"/><span class="star">*</span>
  110. </td>
  111. </tr>
  112. <tr>
  113. <td>IP地址:</td><td><input type="text" class=" validate[required,custom[ip]]"/><span class="star">*</span></td>
  114. <td>非负整数:</td><td><input type="text" class=" validate[required,custom[onlyNumber]]"/><span class="star">*</span></td>
  115. </tr>
  116. <tr>
  117. <td>正负小数:</td><td><input type="text" class=" validate[required,custom[onlyDecimal]]"/><span class="star">*</span></td>
  118. <td>正负整数与小数:</td><td><input type="text" class=" validate[required,custom[onlyNumberWide]]"/><span class="star">*</span></td>
  119. </tr>
  120. <tr>
  121. <td>单选下拉框:</td><td><select class="validate[required]" prompt="请选择" data='{"list":[{"value":"1","key":"北京"},{"value":"2","key":"黑龙江"}]}'></select><span class="star">*</span></td>
  122. <td>树形单选下拉框:</td><td><div class="selectTree validate[required]" data='{"treeNodes":[{ "id":"1", "parentId":"0", "name":"部门1", "open": "true"},{ "id":"11", "parentId":"1", "name":"员工1"},{ "id":"12", "parentId":"1", "name":"员工2"},{ "id":"13", "parentId":"1", "name":"员工3"},{ "id":"2", "parentId":"0", "name":"部门2", "open": "true"},{ "id":"21", "parentId":"2", "name":"员工4"}]}'></div><span class="star">*</span> </td>
  123. </tr>
  124. <tr>
  125. <td>多选下拉框:</td><td><div class="selectTree validate[required]" data='{"treeNodes":[{ "id":"1", "parentId":"0", "name":"员工1"},{ "id":"2", "parentId":"0", "name":"员工2"},{ "id":"3", "parentId":"0", "name":"员工3"},{ "id":"4", "parentId":"0", "name":"员工4"}]}' multiMode="true" noGroup="true"></div><span class="star">*</span> </td>
  126. <td>树形多选下拉框:</td><td><div class="selectTree validate[required]" data='{"treeNodes":[{"id":"1","parentId":"0","name":"部门1","nocheck":"true","clickExpand":"true","open":"true"},{"id":"11","parentId":"1", "name":"员工1"},{"id":"12","parentId":"1", "name":"员工2"},{"id":"13","parentId":"1", "name":"员工3"},{"id":"2","parentId":"0","name":"部门2","nocheck":"true","clickExpand":"true","open":"true"},{"id":"21","parentId":"2", "name":"员工4"}]}' multiMode="true"></div><span class="star">*</span> </td>
  127. </tr>
  128. <tr>
  129. <td>数字步进器:</td><td><input id="step1" type="text" class="stepper validate[required]"/><span class="star">*</span> </td>
  130. <td>软键盘控件:</td><td><input class="keypad validate[required]" type="text"/><span class="star">*</span></td>
  131. </tr>
  132. <tr>
  133. <td>自动完成框:</td><td> <div class="suggestion validate[required]" id="suggestion1" keepDefaultStyle="true" showList="true"></div><span class="star">*</span> </td>
  134. <td>日期选择框:</td><td><input type="text" class="date validate[required,custom[date]]"/><span class="star">*</span></td>
  135. </tr>
  136. <tr>
  137. <td>条件过滤器:</td>
  138. <td colspan="3">
  139. <div class="float_left">
  140. <div class="filter validate[required]" filterWidth="355" data='{"list":[{"value":"1","key":"员工1"},{"value":"2","key":"员工2"},{"value":"3","key":"员工3"},{"value":"4","key":"员工4"}]}'></div>
  141. </div>
  142. <div class="float_left padding_top5">
  143. <span class="star float_left">*</span>
  144. </div>
  145. <div class="clear"></div>
  146. </td>
  147. </tr>
  148. <tr>
  149. <td>双向选择器:</td>
  150. <td colspan="3">
  151. <div class="float_left">
  152. <div class="lister validate[required]" listerWidth="140" listerHeight="120" data='{"fromList":[{"value":"1","key":"员工1"},{"value":"2","key":"员工2"},{"value":"3","key":"员工3"},{"value":"4","key":"员工4"}],"toList":[]}'></div>
  153. </div>
  154. <div class="float_left" style="padding:90px 0 0 0;">
  155. <span class="star float_left">*</span>
  156. </div>
  157. <div class="clear"></div>
  158. </td>
  159. </tr>
  160. <tr>
  161. <td>树形双选器:</td>
  162. <td colspan="3">
  163. <div class="float_left">
  164. <div class="listerTree validate[required]" listerWidth="140" listerHeight="120" data='{"toList":[],"fromList":[{"id":"1","parentId":"0","open":"true","name":"部门1","oldParentId":"null","drag":"false"},{"id":"11","parentId":"1","name":"员工1","oldParentId":"1"},{"id":"12","parentId":"1","name":"员工2","oldParentId":"1"},{"id":"2","parentId":"0","open":"true","name":"部门2","oldParentId":"null","drag":"false"},{"id":"21","parentId":"2","name":"员工4","oldParentId":"2"}]}'></div>
  165. </div>
  166. <div class="float_left" style="padding:80px 0 0 0;">
  167. <span class="star float_left">*</span>
  168. </div>
  169. <div class="clear"></div>
  170. </td>
  171. </tr>
  172. <tr>
  173. <td>文本域:</td>
  174. <td colspan="3">
  175. <div class="float_left">
  176. <textarea class="validate[required]" style="width:350px;"></textarea>
  177. </div>
  178. <div class="float_left" style="padding:40px 0 0 0;">
  179. <span class="star float_left">*</span>
  180. </div>
  181. <div class="clear"></div>
  182. </td>
  183. </tr>
  184. <tr>
  185. <td colspan="4">
  186. <input type="button" value=" 提 交 " onclick="validateForm('#form1');"/>
  187. <input type="button" value=" 重 置 "/>
  188. </td>
  189. </tr>
  190. </table>
  191. </form>
  192. </div>
  193. <script type="text/javascript">
  194. var listdata={"list":[
  195. {value:"1",key:"北京",suggest:"北京|beijing|bj"},
  196. {value:"2",key:"广州",suggest:"广州|guangzhou|gz"},
  197. {value:"3",key:"深圳",suggest:"深圳|shenzhen|sz"},
  198. {value:"4",key:"上海",suggest:"上海|shanghai|sh"},
  199. {value:"5",key:"长沙",suggest:"长沙|changsha|cs"},
  200. {value:"6",key:"成都",suggest:"成都|chengdu|cd"},
  201. {value:"7",key:"贵阳",suggest:"贵阳|guiyang|gy"},
  202. {value:"8",key:"海口",suggest:"海口|haikou|hk"},
  203. {value:"9",key:"杭州",suggest:"杭州|hangzhou|hz"},
  204. {value:"10",key:"昆明",suggest:"昆明|kunming|km"},
  205. {value:"11",key:"南昌",suggest:"南昌|nanchang|nc"},
  206. {value:"12",key:"南京",suggest:"南京|nanjing|nj"},
  207. {value:"13",key:"三亚",suggest:"三亚|sanya|sy"},
  208. {value:"14",key:"沈阳",suggest:"沈阳|shenyang|sy"},
  209. {value:"15",key:"温州",suggest:"温州|wenzhou|wz"},
  210. {value:"16",key:"武汉",suggest:"武汉|wuhan|wh"},
  211. {value:"17",key:"厦门",suggest:"厦门|xiamen|xm"},
  212. {value:"18",key:"西安",suggest:"西安|xian|xa"},
  213. {value:"19",key:"郑州",suggest:"郑州|zhenghou|zz"},
  214. {value:"20",key:"汕头",suggest:"汕头|shantou|st"},
  215. {value:"21",key:"太原",suggest:"太原|taiyuan|ty"},
  216. {value:"22",key:"天津",suggest:"天津|tianjin|tj"}]};
  217. $(function(){
  218. $("#suggestion1").data("data",listdata);
  219. $("#suggestion1").render();
  220. })
  221. //手动触发验证,被验证的表单元素是containerId容器里的。 可以验证整个表单,也可以验证部分表单。
  222. function validateForm(containerId){
  223. var valid = $(containerId).validationEngine({returnIsValid: true});
  224. if(valid == true){
  225. top.Dialog.alert('进行提交处理');
  226. }else{
  227. top.Dialog.alert('表单填写不正确,请按要求填写!');
  228. }
  229. }
  230. </script>
  231. </body>
  232. </html>