form_valid.jsp 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title>uitags</title>
  7. <t:base type="jquery,easyui,tools,autocomplete"></t:base>
  8. <SCRIPT type="text/javascript">
  9. function parse(data){
  10. var parsed = [];
  11. $.each(data.rows,function(index,row){
  12. parsed.push({data:row,result:row,value:row.id});
  13. });
  14. return parsed;
  15. }
  16. /**
  17. * 选择后回调
  18. *
  19. * @param {Object} data
  20. */
  21. function callBack(data) {
  22. $("#user").val(data.userName);
  23. }
  24. /**
  25. * 每一个选择项显示的信息
  26. *
  27. * @param {Object} data
  28. */
  29. function formatItem(data) {
  30. return data.userName + "-->" + " " + data.realName;
  31. }
  32. function setContentc(){
  33. alert("表单提交前想干点啥呢");
  34. }
  35. function test(){
  36. alert("表单提交后要干点啥呢");
  37. }
  38. </SCRIPT>
  39. </head>
  40. <body>
  41. <t:formvalid formid="formobj" dialog="false" layout="div" callback="test" action="jeecgFormvalidController.do?testsubmit=2" beforeSubmit="setContentc">
  42. <fieldset class="step">
  43. <div class="form">
  44. <label class="Validform_label"> 非空验证: </label>
  45. <input type="text" name="demotitle" id="demotitle" datatype="*" errormsg="该字段不为空">
  46. <span class="Validform_checktip"></span>
  47. </div>
  48. <div class="form">
  49. <label class="Validform_label"> URL验证: </label>
  50. <input type="text" name="demourl" id="demourl" datatype="url" errormsg="必须是URL">
  51. <span class="Validform_checktip"></span>
  52. </div>
  53. <div class="form">
  54. <label class="Validform_label"> 至少选择2项: </label>
  55. <input name="shoppingsite1" class="rt2" id="shoppingsite21" type="checkbox" value="1" datatype="need2" nullmsg="请选择您的爱好!" />阅读
  56. <input name="shoppingsite1" class="rt2" id="shoppingsite22" type="checkbox" value="2" /> 音乐
  57. <input name="shoppingsite1" class="rt2" id="shoppingsite23" type="checkbox" value="3" /> 运动
  58. <span class="Validform_checktip"></span>
  59. </div>
  60. <div class="form" id="mail_id">
  61. <label class="Validform_label"> 邮箱: </label>
  62. <input type="text" name="demoorder" id="demoorder" datatype="e" errormsg="邮箱非法">
  63. <span class="Validform_checktip"></span>
  64. </div>
  65. <t:hasPermission code="phone_code">
  66. <div class="form">
  67. <label class="Validform_label"> 手机号: </label>
  68. <input type="text" name="phone" id="phone" datatype="m" errormsg="手机号非法">
  69. <span class="Validform_checktip"></span>
  70. </div>
  71. </t:hasPermission>
  72. <div class="form" id="money_id">
  73. <label class="Validform_label"> 金额: </label>
  74. <input type="text" name="money" id="money" datatype="d" errormsg="金额非法">
  75. <span class="Validform_checktip"></span>
  76. </div>
  77. <div class="form">
  78. <label class="Validform_label"> 日期: </label>
  79. <input type="text" name="date" id="date" class="easyui-datebox">
  80. <span class="Validform_checktip"></span>
  81. </div>
  82. <div class="form">
  83. <label class="Validform_label"> 时间: </label>
  84. <input type="text" name="time" id="time" class="easyui-datetimebox">
  85. <span class="Validform_checktip"></span>
  86. </div>
  87. <div style="text-align:center"><input class="btn" type="submit" value="提交" style="height:30px;width:100px !important;border-radius:5px"></div>
  88. </fieldset>
  89. </t:formvalid>
  90. </body>
  91. </html>
  92. <t:authFilter />