form_wizard.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>H+ 后台主题UI框架 - 表单向导</title>
  7. <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
  8. <meta name="description" content="H+是一个完全响应式,基于Bootstrap3最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术">
  9. <link rel="shortcut icon" href="favicon.ico"> <link href="../css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
  10. <link href="../css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
  11. <link href="../css/plugins/iCheck/custom.css" rel="stylesheet">
  12. <link href="../css/plugins/steps/jquery.steps.css" rel="stylesheet">
  13. <link href="../css/animate.min.css" rel="stylesheet">
  14. <link href="../css/style.min.css?v=4.1.0" rel="stylesheet">
  15. </head>
  16. <body class="gray-bg">
  17. <div class="wrapper wrapper-content animated fadeInRight">
  18. <div class="row">
  19. <div class="col-sm-5">
  20. <div class="jumbotron">
  21. <h1>表单向导</h1>
  22. <p>Smart UI 部件允许您快速创建表单向导接口。</p>
  23. <p><a href="http://www.jquery-steps.com/GettingStarted" target="_blank" class="btn btn-primary btn-lg" role="button">了解 jQuery Steps</a>
  24. </p>
  25. </div>
  26. </div>
  27. <div class="col-sm-7">
  28. <div class="ibox float-e-margins">
  29. <div class="ibox-title">
  30. <h5>基础表单向导</h5>
  31. <div class="ibox-tools">
  32. <a class="collapse-link">
  33. <i class="fa fa-chevron-up"></i>
  34. </a>
  35. <a class="dropdown-toggle" data-toggle="dropdown" href="form_wizard.html#">
  36. <i class="fa fa-wrench"></i>
  37. </a>
  38. <ul class="dropdown-menu dropdown-user">
  39. <li><a href="form_wizard.html#">选项1</a>
  40. </li>
  41. <li><a href="form_wizard.html#">选项2</a>
  42. </li>
  43. </ul>
  44. <a class="close-link">
  45. <i class="fa fa-times"></i>
  46. </a>
  47. </div>
  48. </div>
  49. <div class="ibox-content">
  50. <p>
  51. 这是一个简单的表单向导示例
  52. </p>
  53. <div id="wizard">
  54. <h1>第一步</h1>
  55. <div class="step-content">
  56. <div class="text-center m-t-md">
  57. <h2>第一步</h2>
  58. <p>
  59. 这是第一步的内容
  60. </p>
  61. </div>
  62. </div>
  63. <h1>第二步</h1>
  64. <div class="step-content">
  65. <div class="text-center m-t-md">
  66. <h2>第二步</h2>
  67. <p>
  68. 这是第二步的内容
  69. </p>
  70. </div>
  71. </div>
  72. <h1>第三步</h1>
  73. <div class="step-content">
  74. <div class="text-center m-t-md">
  75. <h2>第三步</h2>
  76. <p>
  77. 这是第三步的内容
  78. </p>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="row">
  87. <div class="col-sm-12">
  88. <div class="ibox">
  89. <div class="ibox-title">
  90. <h5>带验证的表单向导</h5>
  91. <div class="ibox-tools">
  92. <a class="collapse-link">
  93. <i class="fa fa-chevron-up"></i>
  94. </a>
  95. <a class="dropdown-toggle" data-toggle="dropdown" href="form_wizard.html#">
  96. <i class="fa fa-wrench"></i>
  97. </a>
  98. <ul class="dropdown-menu dropdown-user">
  99. <li><a href="form_wizard.html#">选项1</a>
  100. </li>
  101. <li><a href="form_wizard.html#">选项2</a>
  102. </li>
  103. </ul>
  104. <a class="close-link">
  105. <i class="fa fa-times"></i>
  106. </a>
  107. </div>
  108. </div>
  109. <div class="ibox-content">
  110. <h2>
  111. 带验证的表单向导
  112. </h2>
  113. <p>
  114. 下面这个示例展示了如何在表单向导中使用 jQuery Validation 插件
  115. </p>
  116. <form id="form" action="form_wizard.html#" class="wizard-big">
  117. <h1>账户</h1>
  118. <fieldset>
  119. <h2>账户信息</h2>
  120. <div class="row">
  121. <div class="col-sm-8">
  122. <div class="form-group">
  123. <label>用户名 *</label>
  124. <input id="userName" name="userName" type="text" class="form-control required">
  125. </div>
  126. <div class="form-group">
  127. <label>密码 *</label>
  128. <input id="password" name="password" type="text" class="form-control required">
  129. </div>
  130. <div class="form-group">
  131. <label>确认密码 *</label>
  132. <input id="confirm" name="confirm" type="text" class="form-control required">
  133. </div>
  134. </div>
  135. <div class="col-sm-4">
  136. <div class="text-center">
  137. <div style="margin-top: 20px">
  138. <i class="fa fa-sign-in" style="font-size: 180px;color: #e5e5e5 "></i>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. </fieldset>
  144. <h1>个人资料</h1>
  145. <fieldset>
  146. <h2>个人资料信息</h2>
  147. <div class="row">
  148. <div class="col-sm-6">
  149. <div class="form-group">
  150. <label>姓名 *</label>
  151. <input id="name" name="name" type="text" class="form-control required">
  152. </div>
  153. </div>
  154. <div class="col-sm-6">
  155. <div class="form-group">
  156. <label>Email *</label>
  157. <input id="email" name="email" type="text" class="form-control required email">
  158. </div>
  159. <div class="form-group">
  160. <label>地址 *</label>
  161. <input id="address" name="address" type="text" class="form-control">
  162. </div>
  163. </div>
  164. </div>
  165. </fieldset>
  166. <h1>警告</h1>
  167. <fieldset>
  168. <div class="text-center" style="margin-top: 120px">
  169. <h2>你是火星人 :-)</h2>
  170. </div>
  171. </fieldset>
  172. <h1>完成</h1>
  173. <fieldset>
  174. <h2>条款</h2>
  175. <input id="acceptTerms" name="acceptTerms" type="checkbox" class="required">
  176. <label for="acceptTerms">我同意注册条款</label>
  177. </fieldset>
  178. </form>
  179. </div>
  180. </div>
  181. </div>
  182. </div>
  183. </div>
  184. <script src="../js/jquery.min.js?v=2.1.4"></script>
  185. <script src="../js/bootstrap.min.js?v=3.3.6"></script>
  186. <script src="../js/content.min.js?v=1.0.0"></script>
  187. <script src="../js/plugins/staps/jquery.steps.min.js"></script>
  188. <script src="../js/plugins/validate/jquery.validate.min.js"></script>
  189. <script src="../js/plugins/validate/messages_zh.min.js"></script>
  190. <script>
  191. $(document).ready(function(){$("#wizard").steps();$("#form").steps({bodyTag:"fieldset",onStepChanging:function(event,currentIndex,newIndex){if(currentIndex>newIndex){return true}if(newIndex===3&&Number($("#age").val())<18){return false}var form=$(this);if(currentIndex<newIndex){$(".body:eq("+newIndex+") label.error",form).remove();$(".body:eq("+newIndex+") .error",form).removeClass("error")}form.validate().settings.ignore=":disabled,:hidden";return form.valid()},onStepChanged:function(event,currentIndex,priorIndex){if(currentIndex===2&&Number($("#age").val())>=18){$(this).steps("next")}if(currentIndex===2&&priorIndex===3){$(this).steps("previous")}},onFinishing:function(event,currentIndex){var form=$(this);form.validate().settings.ignore=":disabled";return form.valid()},onFinished:function(event,currentIndex){var form=$(this);form.submit()}}).validate({errorPlacement:function(error,element){element.before(error)},rules:{confirm:{equalTo:"#password"}}})});
  192. </script>
  193. </body>
  194. </html>