form.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <!-- Include Choices CSS -->
  8. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/choices.js/public/assets/styles/choices.min.css">
  9. <!-- Include Choices JavaScript -->
  10. <script src="https://cdn.jsdelivr.net/npm/choices.js/public/assets/scripts/choices.min.js"></script>
  11. <link rel="stylesheet" href="normalize.css">
  12. <link rel="stylesheet" href="style.css">
  13. <title>Document</title>
  14. </head>
  15. <body class="body-- nodebug">
  16. <h1>Full-page form (flexbox fields)</h1>
  17. <form class="form form--full-page" action="#" method="post">
  18. <h1 class="form__title">Form title</h1>
  19. <div class="form__field field" id="input-text">
  20. <label class="field__label" for="text">Text</label>
  21. <input class="field__input input" type="text" name="text" label="Text">
  22. <p class="field__error-help-msg"></p>
  23. </div>
  24. <div class="form__field field" id="input-radio">
  25. <label class="field__label" for="radio">Radio</label>
  26. <div class="field__input radio radio--grid">
  27. <input class="radio__option" type="radio" value="Option 1" name="radio" id="option-1">
  28. <label class="radio__label" for="option-1">Option 1</label>
  29. <input class="radio__option" type="radio" value="Option 2" name="radio" id="option 2">
  30. <label class="radio__label" for="option-2">Option 2</label>
  31. <input class="radio__option" type="radio" value="Option 3" name="radio" id="option-3">
  32. <label class="radio__label" for="option-3">Option 3</label>
  33. </div>
  34. <p class="field__error-help-msg"></p>
  35. </div>
  36. </div>
  37. <div class="form__field field" id="input-select">
  38. <label class="field__label" for="select">Select</label>
  39. <select class="field__input select" id="select" name="select">
  40. <option class="select__option" value="option-1">Option 1</option>
  41. <option class="select__option" value="option-2">Option 2</option>
  42. <option class="select__option" value="option-3">Option 3</option>
  43. </select>
  44. <p class="field__error-help-msg"></p>
  45. </div>
  46. <div class="form__field field" id="input-textarea">
  47. <label class="field__label" for="textarea">Textarea</label>
  48. <textarea class="field__input input" id="textarea" type="textarea" name="text" label="Texte"
  49. placeholder="Ajouter une note"></textarea>
  50. <p class="field__error-help-msg"></p>
  51. </div>
  52. <div class="form__field field" id="input-multiple">
  53. <label class="field__label" for="multiple">Select multiple</label>
  54. <select class="select field__input" id="multiple" name="multiple" multiple="">
  55. <option class="select__option" value="option1">Option 1</option>
  56. <option class="select__option" value="option2">Option 2</option>
  57. <option class="select__option" value="option3">Option 3</option>
  58. </select>
  59. <p class="field__error-help-msg"></p>
  60. </div>
  61. <div class="form__field field">
  62. <input class="input input--hidden" type="hidden" name="kind" value="internetcontent">
  63. </div>
  64. <button class="form__submit button button-success" type="submit">Go</button>
  65. </form>
  66. <h1>Full-page form (grid fields)</h1>
  67. <form class="form form--full-page" action="#" method="post">
  68. <h1 class="form__title">Form title</h1>
  69. <div class="form__field field field--grid" id="input-text">
  70. <label class="field__label" for="text">Text</label>
  71. <input class="field__input input" type="text" name="text" label="Text">
  72. </div>
  73. <div class="form__field field field--grid" id="input-radio">
  74. <label class="field__label" for="radio">Radio</label>
  75. <div class="field__input radio radio--grid">
  76. <input class="radio__option" type="radio" value="Option 1" name="radio" id="option-1">
  77. <label class="radio__label" for="option-1">Option 1</label>
  78. <input class="radio__option" type="radio" value="Option 2" name="radio" id="option 2">
  79. <label class="radio__label" for="option-2">Option 2</label>
  80. <input class="radio__option" type="radio" value="Option 3" name="radio" id="option-3">
  81. <label class="radio__label" for="option-3">Option 3</label>
  82. </div>
  83. </div>
  84. <div class="form__field field field--grid" id="input-select">
  85. <label class="field__label" for="select">Select</label>
  86. <select class="field__input select" id="select" name="select">
  87. <option class="select__option" value="option-1">Option 1</option>
  88. <option class="select__option" value="option-2">Option 2</option>
  89. <option class="select__option" value="option-3">Option 3</option>
  90. </select>
  91. </div>
  92. <div class="form__field field field--grid" id="input-textarea">
  93. <label class="field__label" for="textarea">Textarea</label>
  94. <textarea class="field__input input" id="textarea" type="textarea" name="text" label="Texte"
  95. placeholder="Ajouter une note"></textarea>
  96. </div>
  97. <div class="form__field field field--grid" id="input-multiple">
  98. <label class="field__label" for="multiple">Select multiple</label>
  99. <select class="select field__input" id="multiple" name="multiple" multiple="">
  100. <option class="select__option" value="option1">Option 1</option>
  101. <option class="select__option" value="option2">Option 2</option>
  102. <option class="select__option" value="option3">Option 3</option>
  103. </select>
  104. </div>
  105. <input class="input input--hidden" type="hidden" name="kind" value="internetcontent">
  106. <button class="form__submit button button-success" type="submit">Go</button>
  107. </form>
  108. <h1>Full-page form, with errors (grid fields)</h1>
  109. <form class="form form--full-page" action="#" method="post">
  110. <h1 class="form__title">Form title</h1>
  111. <p class="form__error">Please fix the errors</p>
  112. <div class="form__field field field--grid field--error" id="input-text">
  113. <label class="field__label" for="text">Text</label>
  114. <input class="field__input input" type="text" name="text" label="Text">
  115. <p class="field__error">This field is bad, and you should feel bad</p>
  116. </div>
  117. <div class="form__field field field--grid field--error" id="input-radio">
  118. <label class="field__label" for="radio">Radio</label>
  119. <div class="field__input radio radio--grid field--error">
  120. <input class="radio__option" type="radio" value="Option 1" name="radio" id="option-1">
  121. <label class="radio__label" for="option-1">Option 1</label>
  122. <input class="radio__option" type="radio" value="Option 2" name="radio" id="option 2">
  123. <label class="radio__label" for="option-2">Option 2</label>
  124. <input class="radio__option" type="radio" value="Option 3" name="radio" id="option-3">
  125. <label class="radio__label" for="option-3">Option 3</label>
  126. </div>
  127. <p class="field__error">This field is bad, and you should feel bad</p>
  128. </div>
  129. <div class="form__field field field--grid field--error" id="input-select">
  130. <label class="field__label" for="select">Select</label>
  131. <select class="field__input select" id="select" name="select">
  132. <option class="select__option" value="option-1">Option 1</option>
  133. <option class="select__option" value="option-2">Option 2</option>
  134. <option class="select__option" value="option-3">Option 3</option>
  135. </select>
  136. <p class="field__error">This field is bad, and you should feel bad</p>
  137. </div>
  138. <div class="form__field field field--grid field--error" id="input-textarea">
  139. <label class="field__label" for="textarea">Textarea</label>
  140. <textarea class="field__input input" id="textarea" type="textarea" name="text" label="Texte"
  141. placeholder="Ajouter une note"></textarea>
  142. <p class="field__error">This field is bad, and you should feel bad</p>
  143. </div>
  144. <div class="form__field field field--grid" id="input-multiple">
  145. <label class="field__label" for="multiple">Select multiple</label>
  146. <select class="select field__input" id="multiple" name="multiple" multiple="">
  147. <option class="select__option" value="option1">Option 1</option>
  148. <option class="select__option" value="option2">Option 2</option>
  149. <option class="select__option" value="option3">Option 3</option>
  150. </select>
  151. <p class="field__error">This field is bad, and you should feel bad</p>
  152. </div>
  153. <div class="form__field">
  154. <input class="input input--hidden" type="hidden" name="kind" value="internetcontent">
  155. </div>
  156. <button class="form__submit button button-success" type="submit">Go</button>
  157. </form>
  158. <h1>Horizontal, one-line forms</h1>
  159. <form class="form form--horizontal" action="#" method="post">
  160. <div class="form__field">
  161. <div class="field" id="input-text">
  162. <label class="field__label" for="text">Text</label>
  163. <input class="field__input input" type="text" name="text" label="Text">
  164. </div>
  165. </div>
  166. <button class="form__submit button button-success" type="submit">Go</button>
  167. </form>
  168. <form class="form form--horizontal" action="#" method="post">
  169. <div class="form__field">
  170. <div class="field" id="input-select">
  171. <label class="field__label" for="select">Select</label>
  172. <select class="field__input select" id="select" name="select">
  173. <option class="select__option" value="" default disabled>Select an option</option>
  174. <option class="select__option" value="option-1">Option 1</option>
  175. <option class="select__option" value="option-2">Option 2</option>
  176. <option class="select__option" value="option-3">Option 3</option>
  177. </select>
  178. <p class="field__error-help-msg"></p>
  179. </div>
  180. </div>
  181. <button class="form__submit button button-success" type="submit">Go</button>
  182. </form>
  183. <form class="form form--horizontal" action="#" method="post">
  184. <div class="form__field">
  185. <div class="field" id="input-select">
  186. <label class="field__label" for="select">Select multiple</label>
  187. <select class="field__input select" id="select" name="select" multiple>
  188. <option class="select__option" value="" default></option>
  189. <option class="select__option" value="option-1">Option 1</option>
  190. <option class="select__option" value="option-2">Option 2</option>
  191. <option class="select__option" value="option-3">Option 3</option>
  192. </select>
  193. <p class="field__error-help-msg"></p>
  194. </div>
  195. </div>
  196. <button class="form__submit button button-success" type="submit">Go</button>
  197. </form>
  198. <div style="display: flex; align-items: flex-end;">
  199. <form class="form form--horizontal" action="#" method="post">
  200. <div class="form__field">
  201. <div class="field" id="input-text">
  202. <label class="field__label" for="textarea">Textarea</label>
  203. <textarea class="field__input input" id="textarea" type="textarea" name="text" label="Textarea"
  204. placeholder="Ajouter une note"></textarea>
  205. </div>
  206. </div>
  207. <button class="form__submit button button-success" type="submit">Go</button>
  208. </form>
  209. </div>
  210. <h1>Inline forms</h1>
  211. <form class="form form--inline" action="#" method="post">
  212. <h1 class="form__title">the tag</h1>
  213. <button class="form__submit button button--inline button--danger" type="submit">&times;</button>
  214. </form>
  215. <h1>Inline forms (actual)</h1>
  216. <form class="form form--inline " action="#" method="post">
  217. <p class="form__title badge badge--square">connecting</p>
  218. <button class="form__submit button button--inline button--danger" type="submit">×</button>
  219. </form>
  220. <h1>Radio input</h1>
  221. <form class="form form--full-page" action="#" method="post">
  222. <h1 class="form__title">Form title</h1>
  223. <div class="form__field field field--grid" id="input-radio">
  224. <label class="field__label" for="radio">Radio</label>
  225. <div class="field__input radio radio--buttons">
  226. <input class="radio__option" type="radio" value="Option 1" name="radio" id="option-1">
  227. <label class="radio__label" for="option-1">Option 1</label>
  228. <input class="radio__option" type="radio" value="Option 2" name="radio" id="option 2">
  229. <label class="radio__label" for="option-2">Option 2</label>
  230. <input class="radio__option" type="radio" value="Option 3" name="radio" id="option-3">
  231. <label class="radio__label" for="option-3">Option 3</label>
  232. </div>
  233. </div>
  234. <button class="form__submit button button-success" type="submit">Go</button>
  235. </form>
  236. <br>
  237. <br>
  238. </body>
  239. <script>
  240. const choices = new Choices('select', { classNames: { containerOuter: 'choices field__input' } })
  241. </script>
  242. </html>