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.

571 lines
17 KiB

  1. <!DOCTYPE html>
  2. <head>
  3. <!-- Standard Meta -->
  4. <meta charset="utf-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  6. <meta name="viewport" content="width=device-width" />
  7. <!-- Site Properities -->
  8. <meta http-equiv="X-Powered-By" content="DocPad v6.32.0"/>
  9. <title>Form | Semantic UI</title>
  10. <meta name="description" content="Semantic empowers designers and developers by creating a shared vocabulary for UI." />
  11. <meta name="keywords" content="html5, ui, library, framework, javascript" />
  12. <link rel="stylesheet" type="text/css" href="/stylesheets/reset.css">
  13. <link rel="stylesheet" type="text/css" class="ui" href="/ui/flat/elements/icons.css">
  14. <link rel="stylesheet" type="text/css" class="ui" href="/ui/flat/elements/button.css">
  15. <link rel="stylesheet" type="text/css" class="ui" href="/ui/flat/elements/header.css">
  16. <link rel="stylesheet" type="text/css" class="ui" href="/ui/flat/elements/label.css">
  17. <link rel="stylesheet" type="text/css" class="ui" href="/ui/flat/elements/divider.css">
  18. <link rel="stylesheet" type="text/css" class="ui" href="/ui/flat/elements/block.css">
  19. <link rel="stylesheet" type="text/css" class="ui" href="/ui/flat/elements/segment.css">
  20. <link rel="stylesheet" type="text/css" class="ui" href="/ui/flat/collections/grid.css">
  21. <link rel="stylesheet" type="text/css" class="ui" href="/ui/flat/collections/table.css">
  22. <link rel="stylesheet" type="text/css" class="ui" href="/ui/flat/collections/form.css">
  23. <link rel="stylesheet" type="text/css" class="ui" href="/ui/flat/collections/menu.css">
  24. <link rel="stylesheet" type="text/css" class="ui" href="/ui/flat/modules/shape.css">
  25. <link rel="stylesheet" type="text/css" class="ui" href="/ui/flat/modules/checkbox.css">
  26. <link rel="stylesheet" type="text/css" href="/stylesheets/library/sidr.css">
  27. <link rel="stylesheet" type="text/css" href="/stylesheets/semantic.css">
  28. <link rel="stylesheet" type="text/css" href="/stylesheets/shape.css">
  29. <script src="/javascript/library/jquery.js"></script>
  30. <script src="/javascript/library/ace/ace.js"></script>
  31. <script src="/javascript/library/sidr.js"></script>
  32. <script src="/javascript/library/waypoints.js"></script>
  33. <script src="/ui/flat/modules/behavior/state.js"></script>
  34. <script src="/ui/flat/modules/shape.js"></script>
  35. <script src="/ui/flat/modules/checkbox.js"></script>
  36. <script src="/javascript/semantic.js"></script>
  37. <script src="/javascript/shape.js"></script>
  38. </head>
  39. <body id="example">
  40. <div class="ui large vertical menu" id="menu">
  41. <div class="header item">Table of Contents</div>
  42. <div class="item"><a href="/index.html"><b>Introduction</b></a></div>
  43. <div class="item"><a href="/download.html"><b>Download</b></a></div>
  44. <div class="item">
  45. <a href="/element.html"><b>UI Elements</b></a>
  46. <div class="menu">
  47. <a class="item" href="/elements/button.html">Button</a>
  48. <a class="item" href="/elements/label.html">Label</a>
  49. </div>
  50. </div>
  51. <div class="item">
  52. <a href="/collection.html"><b>UI Collections</b></a>
  53. <div class="menu">
  54. <a class="active item" href="/collections/form.html">Form</a>
  55. <a class="item" href="/collections/grid.html">Grid</a>
  56. <a class="item" href="/collections/menu.html">Menu</a>
  57. <a class="item" href="/collections/table.html">Table</a>
  58. <a class="item" href="/collections/block.html">Text Block</a>
  59. </div>
  60. </div>
  61. <div class="item">
  62. <a href="/module.html"><b>UI Modules</b></a>
  63. <div class="menu">
  64. <a class="item" href="/modules/shape.html">Shape</a>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="ui fixed transparent contrasting main menu">
  69. <div class="container">
  70. <div class="title item">
  71. <b>UI Collection:</b> Form
  72. </div>
  73. <div class="icon previous link disabled item">
  74. <i class="icon left-open"></i>
  75. </div>
  76. <div class="section dropdown item">
  77. 1 of 5
  78. <div class="menu">
  79. <div class="active item">
  80. <a href="/collections/form.html">1. Form</a>
  81. </div>
  82. <div class="item">
  83. <a href="/collections/grid.html">2. Grid</a>
  84. </div>
  85. <div class="item">
  86. <a href="/collections/menu.html">3. Menu</a>
  87. </div>
  88. <div class="item">
  89. <a href="/collections/table.html">4. Table</a>
  90. </div>
  91. <div class="item">
  92. <a href="/collections/block.html">5. Text Block</a>
  93. </div>
  94. </div>
  95. </div>
  96. <div class="icon next link item">
  97. <a href="/collections/grid.html"><i class="icon right-open"></i></a>
  98. </div>
  99. <div class="right menu">
  100. <a class="item" href="https://github.com/quirkyinc/semantic">
  101. <i class="icon github"></i>
  102. </a>
  103. <div class="dropdown item">
  104. <i class="icon tint"></i> Theme
  105. <div class="theme menu">
  106. <div class="active item" data-theme="flat">Flat</div>
  107. <div class="item" data-theme="shaded">Shaded</div>
  108. <div class="item" data-theme="classic">Classic</div>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. <div class="ui huge left attached vertical side buttons">
  115. <div class="ui large blue sidebar button"><i class="icon th-list"></i> Menu</div>
  116. </div>
  117. <div class="segment">
  118. <div class="container">
  119. <h1>Form</h1>
  120. <p>Forms are a grouping of elements requiring user input.</p>
  121. <p>
  122. Forms always include fields, and fields always contain form elements. Fields themselves may also include:
  123. <a href="#">standard form fields</a>, like labels, inputs and textareas, as well as:
  124. <a href="#">checkboxes</a>,
  125. <a href="#">sliders</a>, and
  126. <a href="#">message blocks</a>.
  127. </p>
  128. <p>Validation messages are <a href="#">text blocks</a> which are formatted for use inside forms.</p>
  129. </div>
  130. </div>
  131. <div class="main container">
  132. <div class="peek">
  133. <div class="ui vertical pointing link menu">
  134. <div class="active item">Collection</div>
  135. <div class="item">Elements</div>
  136. <div class="item">States</div>
  137. <div class="item">Variations</div>
  138. </div>
  139. </div>
  140. <h2>Collection</h2>
  141. <div class="example">
  142. <h4>Form:</h4>
  143. <p>A form is a collection of user input elements, and has no stylings of its own.</p>
  144. <div class="ui info block">
  145. <p>This example uses a ui segment to add the padding and background color. This is not required.</p>
  146. </div>
  147. <div class="ui form segment">
  148. <p>Let's go ahead and get you signed up.</p>
  149. <div class="two fields">
  150. <div class="field">
  151. <label>First Name</label>
  152. <input placeholder="First Name" type="text">
  153. </div>
  154. <div class="field">
  155. <label>Last Name</label>
  156. <input placeholder="Last Name" type="text">
  157. </div>
  158. </div>
  159. <div class="field">
  160. <label>Username</label>
  161. <input placeholder="Username" type="text">
  162. </div>
  163. <div class="field">
  164. <label>Password</label>
  165. <input type="password">
  166. </div>
  167. <div class="inline field">
  168. <div class="ui checkbox">
  169. <input type="checkbox" id="terms" />
  170. <label for="terms"></label>
  171. </div>
  172. <label>I agree to the terms and conditions</label>
  173. </div>
  174. <div class="ui blue submit button">Submit</div>
  175. </div>
  176. </div>
  177. <h2>Elements</h2>
  178. <div class="example">
  179. <h4>Field</h4>
  180. <p>A field is a form element containing a label and an input</p>
  181. <div class="ui form">
  182. <div class="field">
  183. <label>User Input</label>
  184. <input type="text">
  185. </div>
  186. </div>
  187. </div>
  188. <div class="example">
  189. <h4>Text Area</h4>
  190. <p>A textarea uses the default form element</p>
  191. <div class="ui form">
  192. <div class="field">
  193. <label>User Text</label>
  194. <textarea></textarea>
  195. </div>
  196. </div>
  197. </div>
  198. <div class="example">
  199. <h4>Checkbox</h4>
  200. <p>Checkboxes are styled forms of standard form checkboxes.</p>
  201. <div class="ui form">
  202. <div class="field">
  203. <label>Checkbox (Using attribute ID to trigger checked event)</label>
  204. <div class="ui checkbox">
  205. <input type="checkbox" id="uniqueid" />
  206. <label for="uniqueid"></label>
  207. </div>
  208. </div>
  209. <div class="field">
  210. <label>Checkbox (<a href="#">Javascript</a>)</label>
  211. <div class="ui checkbox">
  212. <input type="checkbox"/>
  213. <label></label>
  214. </div>
  215. </div>
  216. </div>
  217. </div>
  218. <div class="example">
  219. <h4>Text Block</h4>
  220. <p>Text blocks have special meaning inside a form tag. All message blocks are hidden by default.</p>
  221. <div class="ui form">
  222. <div class="ui block">
  223. <div class="header">We had some issues</div>
  224. <ul class="list">
  225. <li>Please enter your first name</li>
  226. <li>Please enter your last name</li>
  227. </ul>
  228. </div>
  229. </div>
  230. </div>
  231. <h2>States</h2>
  232. <h3>Form</h3>
  233. <div class="example">
  234. <h4>Loading</h4>
  235. <p>If a form is in loading state, it will automatically show a loading indicator:</p>
  236. <div class="ui loading form segment">
  237. <div class="two fields">
  238. <div class="field">
  239. <label>First Name</label>
  240. <input placeholder="First Name" type="text">
  241. </div>
  242. <div class="field">
  243. <label>Last Name</label>
  244. <input placeholder="Last Name" type="text">
  245. </div>
  246. </div>
  247. <div class="field">
  248. <label>Username</label>
  249. <input placeholder="Username" type="text">
  250. </div>
  251. <div class="field">
  252. <label>Password</label>
  253. <input type="password">
  254. </div>
  255. <div class="inline field">
  256. <div class="ui checkbox">
  257. <input type="checkbox" id="terms" />
  258. <label for="terms"></label>
  259. </div>
  260. <label>I agree to the terms and conditions</label>
  261. </div>
  262. <div class="ui blue submit button">Submit</div>
  263. </div>
  264. </div>
  265. <div class="example">
  266. <h4>Error</h4>
  267. <p>If a form is in an error state, it will automatically show any error message blocks:</p>
  268. <div class="ui error form segment">
  269. <div class="ui error block">
  270. <div class="header">Action Forbidden</div>
  271. <p>You can only sign up for an account once with a given e-mail address.</p>
  272. </div>
  273. <div class="two fields">
  274. <div class="field">
  275. <label>First Name</label>
  276. <input placeholder="First Name" type="text">
  277. </div>
  278. <div class="field">
  279. <label>Last Name</label>
  280. <input placeholder="Last Name" type="text">
  281. </div>
  282. </div>
  283. <div class="field">
  284. <label>Username</label>
  285. <input placeholder="Username" type="text">
  286. </div>
  287. <div class="field">
  288. <label>Password</label>
  289. <input type="password">
  290. </div>
  291. <div class="inline field">
  292. <div class="ui checkbox">
  293. <input type="checkbox" id="terms" />
  294. <label for="terms"></label>
  295. </div>
  296. <label>I agree to the terms and conditions</label>
  297. </div>
  298. <div class="ui blue submit button">Submit</div>
  299. </div>
  300. </div>
  301. <div class="example">
  302. <h4>Warning</h4>
  303. <p>If a form is in warning state, it will automatically show any warning message block:</p>
  304. <div class="ui warning form segment">
  305. <div class="ui warning block">
  306. <div class="header">Could you check something!</div>
  307. <ul class="list">
  308. <li>You forgot your <b>first name</b></li>
  309. <li>And also your <b>last name</b></li>
  310. </ul>
  311. </div>
  312. <div class="two error fields">
  313. <div class="field">
  314. <label>First Name</label>
  315. <input placeholder="First Name" type="text">
  316. </div>
  317. <div class="field">
  318. <label>Last Name</label>
  319. <input placeholder="Last Name" type="text">
  320. </div>
  321. </div>
  322. <div class="field">
  323. <label>Username</label>
  324. <input placeholder="Username" type="text">
  325. </div>
  326. <div class="field">
  327. <label>Password</label>
  328. <input type="password">
  329. </div>
  330. <div class="inline field">
  331. <div class="ui checkbox">
  332. <input type="checkbox" id="terms" />
  333. <label for="terms"></label>
  334. </div>
  335. <label>I agree to the terms and conditions</label>
  336. </div>
  337. <div class="ui blue submit button">Submit</div>
  338. </div>
  339. </div>
  340. <h3>Form Fields</h3>
  341. <div class="example">
  342. <h4>Error</h4>
  343. <p>Individual fields may contain an error state</p>
  344. <div class="ui error form segment">
  345. <div class="two fields">
  346. <div class="field error">
  347. <label>First Name</label>
  348. <input placeholder="First Name" type="text">
  349. </div>
  350. <div class="field">
  351. <label>Last Name</label>
  352. <input placeholder="Last Name" type="text">
  353. </div>
  354. </div>
  355. </div>
  356. </div>
  357. <div class="example">
  358. <h4>Disabled</h4>
  359. <p>Individual fields may be disabled or read only</p>
  360. <div class="ui error form segment">
  361. <div class="two fields">
  362. <div class="field">
  363. <label>First Name</label>
  364. <input placeholder="Read Only" readonly="readonly" type="text">
  365. </div>
  366. <div class="disabled field">
  367. <label>Last Name</label>
  368. <input placeholder="Disabled" disabled="disabled" type="text">
  369. </div>
  370. </div>
  371. </div>
  372. </div>
  373. <h2>Variations</h2>
  374. <h3>Forms</h3>
  375. <div class="example">
  376. <h4>Fluid</h4>
  377. <p>A form can take the width of its container</p>
  378. <div class="ui fluid form segment">
  379. <div class="two fields">
  380. <div class="field">
  381. <label>First Name</label>
  382. <input placeholder="First Name" type="text">
  383. </div>
  384. <div class="field">
  385. <label>Last Name</label>
  386. <input placeholder="Last Name" type="text">
  387. </div>
  388. </div>
  389. <div class="ui blue submit button">Submit</div>
  390. </div>
  391. </div>
  392. <div class="example">
  393. <h4>Size</h4>
  394. <p>A form can also be small or large</p>
  395. <div class="ui small form segment">
  396. <div class="two fields">
  397. <div class="field">
  398. <label>First Name</label>
  399. <input placeholder="First Name" type="text">
  400. </div>
  401. <div class="field">
  402. <label>Last Name</label>
  403. <input placeholder="Last Name" type="text">
  404. </div>
  405. </div>
  406. <div class="ui blue small submit button">Submit</div>
  407. </div>
  408. <br><br>
  409. <div class="ui large form segment">
  410. <div class="two fields">
  411. <div class="field">
  412. <label>First Name</label>
  413. <input placeholder="First Name" type="text">
  414. </div>
  415. <div class="field">
  416. <label>Last Name</label>
  417. <input placeholder="Last Name" type="text">
  418. </div>
  419. </div>
  420. <div class="ui blue submit button">Submit</div>
  421. </div>
  422. </div>
  423. <div class="example">
  424. <h4>Inverted</h4>
  425. <p>A form on a dark background may have to invert its color scheme</p>
  426. <div style="background-color: #333333; padding: 15px;">
  427. <div class="ui inverted form">
  428. <div class="ui info block">
  429. <div class="header">We had some issues</div>
  430. <ul class="list">
  431. <li>Please enter your first name</li>
  432. <li>Please enter your last name</li>
  433. </ul>
  434. </div>
  435. <div class="two fields">
  436. <div class="error field">
  437. <label>First Name</label>
  438. <input placeholder="First Name" type="text">
  439. </div>
  440. <div class="field">
  441. <label>Last Name</label>
  442. <input placeholder="Last Name" type="text">
  443. </div>
  444. </div>
  445. <div class="ui blue submit button">Submit</div>
  446. </div>
  447. </div>
  448. </div>
  449. <h3>Fields</h3>
  450. <div class="example">
  451. <h4>Inline</h4>
  452. <p>A field can have its label next to instead of above it.</p>
  453. <div class="ui form">
  454. <div class="ui inline fields">
  455. <div class="field">
  456. <label>Last name</label>
  457. <input type="text" placeholder="Full Name">
  458. </div>
  459. </div>
  460. </div>
  461. </div>
  462. <div class="example">
  463. <h4>Date</h4>
  464. <p>A field can let users know they are for dates</p>
  465. <div class="ui form">
  466. <div class="date field">
  467. <label>Birthday</label>
  468. <input type="text" placeholder="Full Name">
  469. </div>
  470. </div>
  471. </div>
  472. <h2>Groups</h2>
  473. <div class="example">
  474. <h4>Field Groups</h4>
  475. <p>Fields can exist side by side to show relation</p>
  476. <div class="ui form">
  477. <div class="ui three fields">
  478. <div class="field">
  479. <label>First name</label>
  480. <input type="text" placeholder="First Name">
  481. </div>
  482. <div class="field">
  483. <label>Middle name</label>
  484. <input type="text" placeholder="Middle Name">
  485. </div>
  486. <div class="field">
  487. <label>Last name</label>
  488. <input type="text" placeholder="Last Name">
  489. </div>
  490. </div>
  491. </div>
  492. </div>
  493. </div>
  494. </body>
  495. </html>
  496. </body>
  497. </html>