You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.4 KiB

  1. ---
  2. layout : 'default'
  3. css : 'hotfix'
  4. title : 'Test Page'
  5. type : 'Library'
  6. ---
  7. <%- @partial('header') %>
  8. <script src="/build/uncompressed/modules/behavior/form.js"></script>
  9. <script type='text/javascript'>
  10. $(document).ready(function(){
  11. $('.ui.form.one')
  12. .form({
  13. name: {
  14. identifier : 'name',
  15. rules: [
  16. {
  17. type : 'empty',
  18. prompt : 'Please enter your full name'
  19. }
  20. ]
  21. },
  22. email: {
  23. identifier : 'email',
  24. rules: [
  25. {
  26. type : 'empty',
  27. prompt : 'Please enter your email'
  28. },
  29. {
  30. type : 'email',
  31. prompt : 'please enter a proper email'
  32. }
  33. ]
  34. },
  35. username: {
  36. identifier : 'username',
  37. rules: [
  38. {
  39. type : 'empty',
  40. prompt : 'Please enter a username'
  41. }
  42. ]
  43. },
  44. password: {
  45. identifier : 'password',
  46. rules: [
  47. {
  48. type : 'empty',
  49. prompt : 'Please enter a password'
  50. },
  51. {
  52. type : 'length[6]',
  53. prompt : 'Your password must be at least 6 characters'
  54. }
  55. ]
  56. },
  57. terms: {
  58. identifier : 'terms1',
  59. rules: [
  60. {
  61. type : 'checked',
  62. prompt : 'You must agree to the terms and conditions'
  63. }
  64. ]
  65. }
  66. }, {
  67. inline : true,
  68. on : 'blur'
  69. });
  70. $('form').form('add prompt', 'username', 'that username is already taken');
  71. });
  72. </script>
  73. <div class="main container">
  74. <form class="ui form one" method="post" action="/test">
  75. <div class="field">
  76. <input type="text" name="name" placeholder="Name" />
  77. </div>
  78. <div class="field">
  79. <input type="text" name="email" placeholder="E-mail" />
  80. </div>
  81. <div class="field">
  82. <input type="text" name="username" placeholder="username" />
  83. </div>
  84. <div class="field">
  85. <input type="password" name="password"/>
  86. </div>
  87. <div class="inline field">
  88. <div class="ui checkbox">
  89. <input type="checkbox" id="terms1" name="terms1"/>
  90. <label for="terms1">Accept terms</label>
  91. </div>
  92. </div>
  93. <div class="ui submit button">Submit</div>
  94. </form>
  95. </div>