PageRenderTime 52ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/forms.html

https://gitlab.com/x33n/materialize
HTML | 801 lines | 750 code | 40 blank | 11 comment | 0 complexity | b94fcfd1b3a7508dbd94bc95e16828a7 MD5 | raw file
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="msapplication-tap-highlight" content="no">
  8. <meta name="description" content="Materialize is a modern responsive CSS framework based on Material Design by Google. ">
  9. <title>Forms - Materialize</title>
  10. <!-- Favicons-->
  11. <link rel="apple-touch-icon-precomposed" href="images/favicon/apple-touch-icon-152x152.png">
  12. <meta name="msapplication-TileColor" content="#FFFFFF">
  13. <meta name="msapplication-TileImage" content="images/favicon/mstile-144x144.png">
  14. <link rel="icon" href="images/favicon/favicon-32x32.png" sizes="32x32">
  15. <!-- Android 5 Chrome Color-->
  16. <meta name="theme-color" content="#EE6E73">
  17. <!-- CSS-->
  18. <link href="css/prism.css" rel="stylesheet">
  19. <link href="css/ghpages-materialize.css" type="text/css" rel="stylesheet" media="screen,projection">
  20. <link href="http://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css">
  21. <script>
  22. window.liveSettings = {
  23. api_key: "a0b49b34b93844c38eaee15690d86413",
  24. picker: "bottom-right",
  25. detectlang: true,
  26. dynamic: true,
  27. autocollect: true
  28. };
  29. </script>
  30. <script src="//cdn.transifex.com/live.js"></script>
  31. </head>
  32. <body>
  33. <header>
  34. <nav class="top-nav">
  35. <div class="container">
  36. <div class="nav-wrapper"><a class="page-title">Forms</a></div>
  37. </div>
  38. </nav>
  39. <div class="container"><a href="#" data-activates="nav-mobile" class="button-collapse top-nav full"><i class="mdi-navigation-menu"></i></a></div>
  40. <ul id="nav-mobile" class="side-nav fixed">
  41. <li class="logo"><a id="logo-container" href="http://materializecss.com/" class="brand-logo">
  42. <object id="front-page-logo" type="image/svg+xml" data="res/materialize.svg">Your browser does not support SVG</object></a></li>
  43. <li class="bold"><a href="about.html" class="waves-effect waves-teal">About</a></li>
  44. <li class="bold"><a href="getting-started.html" class="waves-effect waves-teal">Getting Started</a></li>
  45. <li class="no-padding">
  46. <ul class="collapsible collapsible-accordion">
  47. <li class="bold"><a class="collapsible-header waves-effect waves-teal">CSS</a>
  48. <div class="collapsible-body">
  49. <ul>
  50. <li><a href="color.html">Color</a></li>
  51. <li><a href="grid.html">Grid</a></li>
  52. <li><a href="helpers.html">Helpers</a></li>
  53. <li><a href="media-css.html">Media</a></li>
  54. <li><a href="sass.html">Sass</a></li>
  55. <li><a href="shadow.html">Shadow</a></li>
  56. <li><a href="table.html">Table</a></li>
  57. <li><a href="typography.html">Typography</a></li>
  58. </ul>
  59. </div>
  60. </li>
  61. <li class="bold"><a class="collapsible-header active waves-effect waves-teal">Components</a>
  62. <div class="collapsible-body">
  63. <ul>
  64. <li><a href="badges.html">Badges</a></li>
  65. <li><a href="buttons.html">Buttons</a></li>
  66. <li><a href="cards.html">Cards</a></li>
  67. <li><a href="collections.html">Collections</a></li>
  68. <li><a href="footer.html">Footer</a></li>
  69. <li class="active"><a href="forms.html">Forms</a></li>
  70. <li><a href="icons.html">Icons</a></li>
  71. <li><a href="navbar.html">Navbar</a></li>
  72. <li><a href="pagination.html">Pagination</a></li>
  73. <li><a href="preloader.html">Preloader</a></li>
  74. </ul>
  75. </div>
  76. </li>
  77. <li class="bold"><a class="collapsible-header waves-effect waves-teal">JavaScript</a>
  78. <div class="collapsible-body">
  79. <ul>
  80. <li><a href="collapsible.html">Collapsible</a></li>
  81. <li><a href="dialogs.html">Dialogs</a></li>
  82. <li><a href="dropdown.html">Dropdown</a></li>
  83. <li><a href="media.html">Media</a></li>
  84. <li><a href="modals.html">Modals</a></li>
  85. <li><a href="parallax.html">Parallax</a></li>
  86. <li><a href="pushpin.html">Pushpin</a></li>
  87. <li><a href="scrollfire.html">ScrollFire</a></li>
  88. <li><a href="scrollspy.html">Scrollspy</a></li>
  89. <li><a href="side-nav.html">SideNav</a></li>
  90. <li><a href="tabs.html">Tabs</a></li>
  91. <li><a href="transitions.html">Transitions</a></li>
  92. <li><a href="waves.html">Waves</a></li>
  93. </ul>
  94. </div>
  95. </li>
  96. </ul>
  97. </li>
  98. <li class="bold"><a href="http://materializecss.com/mobile.html" class="waves-effect waves-teal">Mobile</a></li>
  99. <li class="bold"><a href="showcase.html" class="waves-effect waves-teal">Showcase</a></li>
  100. </ul>
  101. </header>
  102. <main><div class="container">
  103. <div class="row">
  104. <div class="col s12 m9 l10">
  105. <div id="input" class="section scrollspy">
  106. <p class="caption">
  107. Forms are the standard way to receive user inputted data. The transitions and smoothness of these elements are very important because of the inherent user interaction associated with forms.
  108. </p>
  109. <h2 class="header">Input fields</h2>
  110. <p>Text fields allow user input. The border should light up simply and clearly indicating which field the user is currently editing. You must have a <code class="language-markup">.input-field</code> div wrapping your input and label. This helps our jQuery animate the label. This is only used in our Input and Textarea form elements.</p>
  111. <p>If you don't want the Green and Red validation states, just remove the <code class="language-markup">validate</code> class from your inputs.</p>
  112. <br>
  113. <div class="row">
  114. <form class="col s12">
  115. <div class="row">
  116. <div class="input-field col s6">
  117. <input placeholder="Placeholder" id="first_name" type="text" class="validate">
  118. <label for="first_name">First Name</label>
  119. </div>
  120. <div class="input-field col s6">
  121. <input id="last_name" type="text">
  122. <label for="last_name">Last Name</label>
  123. </div>
  124. </div>
  125. <div class="row">
  126. <div class="input-field col s12">
  127. <input disabled value="I am not editable" id="disabled" type="text" class="validate">
  128. <label for="disabled">Disabled</label>
  129. </div>
  130. </div>
  131. <div class="row">
  132. <div class="input-field col s12">
  133. <input id="password" type="password" class="validate">
  134. <label for="password">Password</label>
  135. </div>
  136. </div>
  137. <div class="row">
  138. <div class="input-field col s12">
  139. <input id="email" type="email" class="validate">
  140. <label for="email">Email</label>
  141. </div>
  142. </div>
  143. </form>
  144. </div>
  145. <pre><code class="language-markup">
  146. &lt;div class="row">
  147. &lt;form class="col s12">
  148. &lt;div class="row">
  149. &lt;div class="input-field col s6">
  150. &lt;input placeholder="Placeholder" id="first_name" type="text" class="validate">
  151. &lt;label for="first_name">First Name&lt;/label>
  152. &lt;/div>
  153. &lt;div class="input-field col s6">
  154. &lt;input id="last_name" type="text" class="validate">
  155. &lt;label for="last_name">Last Name&lt;/label>
  156. &lt;/div>
  157. &lt;/div>
  158. &lt;div class="row">
  159. &lt;div class="input-field col s12">
  160. &lt;input disabled value="I am not editable" id="disabled" type="text" class="validate">
  161. &lt;label for="disabled">Disabled&lt;/label>
  162. &lt;/div>
  163. &lt;/div>
  164. &lt;div class="row">
  165. &lt;div class="input-field col s12">
  166. &lt;input id="password" type="password" class="validate">
  167. &lt;label for="password">Password&lt;/label>
  168. &lt;/div>
  169. &lt;/div>
  170. &lt;div class="row">
  171. &lt;div class="input-field col s12">
  172. &lt;input id="email" type="email" class="validate">
  173. &lt;label for="email">Email&lt;/label>
  174. &lt;/div>
  175. &lt;/div>
  176. &lt;/form>
  177. &lt;/div>
  178. </code></pre><br>
  179. <h4>Prefilling Text Inputs</h4>
  180. <p>If you are having trouble with the labels overlapping prefilled content, Try adding <code class="language-markup">class="active"</code> to the label</p>
  181. <div class="row">
  182. <div class="input-field col s6">
  183. <input value="Alvin" id="first_name2" type="text" class="validate">
  184. <label class="active" for="first_name2">First Name</label>
  185. </div>
  186. </div>
  187. <pre><code class="language-markup">
  188. &lt;div class="row">
  189. &lt;div class="input-field col s6">
  190. &lt;input value="Alvin" id="first_name2" type="text" class="validate">
  191. &lt;label class="active" for="first_name2">First Name&lt;/label>
  192. &lt;/div>
  193. &lt;/div>
  194. </code></pre>
  195. <h4>Icon Prefixes</h4>
  196. <p>You can add an icon prefix to make the form input label even more clear. Just add an icon with the class <code class="language-markup">prefix</code> before the input and label.</p><br>
  197. <div class="row">
  198. <form class="col s12">
  199. <div class="row">
  200. <div class="input-field col s6">
  201. <i class="mdi-action-account-circle prefix"></i>
  202. <input id="icon_prefix" type="text" class="validate">
  203. <label for="icon_prefix">First Name</label>
  204. </div>
  205. <div class="input-field col s6">
  206. <i class="mdi-communication-phone prefix"></i>
  207. <input id="icon_telephone" type="tel" class="validate">
  208. <label for="icon_telephone">Telephone</label>
  209. </div>
  210. </div>
  211. </form>
  212. </div>
  213. <pre><code class="language-markup">
  214. &lt;div class="row">
  215. &lt;form class="col s12">
  216. &lt;div class="row">
  217. &lt;div class="input-field col s6">
  218. &lt;i class="mdi-action-account-circle prefix">&lt;/i>
  219. &lt;input id="icon_prefix" type="text" class="validate">
  220. &lt;label for="icon_prefix">First Name&lt;/label>
  221. &lt;/div>
  222. &lt;div class="input-field col s6">
  223. &lt;i class="mdi-communication-phone prefix">&lt;/i>
  224. &lt;input id="icon_telephone" type="tel" class="validate">
  225. &lt;label for="icon_telephone">Telephone&lt;/label>
  226. &lt;/div>
  227. &lt;/div>
  228. &lt;/form>
  229. &lt;/div>
  230. </code></pre>
  231. <h4>Changing colors</h4>
  232. <p>Here is a CSS template for modifying input fields in CSS. With Sass, you can achieve this by just changing a variable. The CSS shown below is unprefixed. Depending on what you use, you may have to change the type attribute selector.</p>
  233. <pre><code class="language-css">
  234. /* label color */
  235. .input-field label {
  236. color: #000;
  237. }
  238. /* label focus color */
  239. .input-field input[type=text]:focus + label {
  240. color: #000;
  241. }
  242. /* label underline focus color */
  243. .input-field input[type=text]:focus {
  244. border-bottom: 1px solid #000;
  245. box-shadow: 0 1px 0 0 #000;
  246. }
  247. /* valid color */
  248. .input-field input[type=text].valid {
  249. border-bottom: 1px solid #000;
  250. box-shadow: 0 1px 0 0 #000;
  251. }
  252. /* invalid color */
  253. .input-field input[type=text].invalid {
  254. border-bottom: 1px solid #000;
  255. box-shadow: 0 1px 0 0 #000;
  256. }
  257. /* icon prefix focus color */
  258. .input-field .prefix.active {
  259. color: #000;
  260. }
  261. </code></pre>
  262. </div>
  263. <!-- Textarea Section -->
  264. <div id="textarea" class="section scrollspy">
  265. <h2 class="header">Textarea</h2>
  266. <p>Textareas allow larger expandable user input. The border should light up simply and clearly indicating which field the user is currently editing. You must have a <code class="language-markup">.input-field</code> div wrapping your input and label. This helps our jQuery animate the label. This is only used in our Input and Textarea form elements.</p>
  267. <p><strong>Textareas will auto resize to the text inside.</strong></p>
  268. <div class="row">
  269. <form class="col s12">
  270. <div class="row">
  271. <div class="input-field col s12">
  272. <textarea id="textarea1" class="materialize-textarea"></textarea>
  273. <label for="textarea1">Textarea</label>
  274. </div>
  275. </div>
  276. </form>
  277. </div>
  278. <pre><code class="language-markup">
  279. &lt;div class="row">
  280. &lt;form class="col s12">
  281. &lt;div class="row">
  282. &lt;div class="input-field col s12">
  283. &lt;textarea id="textarea1" class="materialize-textarea">&lt;/textarea>
  284. &lt;label for="textarea1">Textarea&lt;/label>
  285. &lt;/div>
  286. &lt;/div>
  287. &lt;/form>
  288. &lt;/div>
  289. </code></pre><br>
  290. <h4>Icon Prefixes</h4>
  291. <p>You can add an icon prefix to make the form input label even more clear. Just add an icon with the class <code class="language-markup">prefix</code> before the input and label.</p><br>
  292. <div class="row">
  293. <form class="col s12">
  294. <div class="row">
  295. <div class="input-field col s12">
  296. <i class="mdi-editor-mode-edit prefix"></i>
  297. <textarea id="icon_prefix2" class="materialize-textarea"></textarea>
  298. <label for="icon_prefix2">Message</label>
  299. </div>
  300. </div>
  301. </form>
  302. </div>
  303. <pre><code class="language-markup">
  304. &lt;div class="row">
  305. &lt;form class="col s12">
  306. &lt;div class="row">
  307. &lt;div class="input-field col s6">
  308. &lt;i class="mdi-editor-mode-edit prefix">&lt;/i>
  309. &lt;textarea id="icon_prefix2" class="materialize-textarea">&lt;/textarea>
  310. &lt;label for="icon_prefix2">First Name&lt;/label>
  311. &lt;/div>
  312. &lt;/div>
  313. &lt;/form>
  314. &lt;/div>
  315. </code></pre>
  316. </div>
  317. <div id="select" class="section scrollspy">
  318. <h2 class="header">Select</h2>
  319. <p> Select allows user input through specified options. </p>
  320. <div class="row">
  321. <form class="col s12 m6">
  322. <div class="row">
  323. <div class="col s12">
  324. <label>Materialize Select</label>
  325. <select>
  326. <option value="" disabled selected>Choose your option</option>
  327. <option value="1">Option 1</option>
  328. <option value="2">Option 2</option>
  329. <option value="3">Option 3</option>
  330. </select>
  331. </div>
  332. <div class="col s12">
  333. <br>
  334. <p>You can add the class <code class="language-markup">browser-default</code> to get the browser default.</p>
  335. <label>Browser Select</label>
  336. <select class="browser-default">
  337. <option value="" disabled selected>Choose your option</option>
  338. <option value="1">Option 1</option>
  339. <option value="2">Option 2</option>
  340. <option value="3">Option 3</option>
  341. </select>
  342. </div>
  343. </div>
  344. </form>
  345. <div class="col s12">
  346. <pre><code class="language-markup">
  347. &lt;label>Materialize Select&lt;/label>
  348. &lt;select>
  349. &lt;option value="" disabled selected>Choose your option&lt;/option>
  350. &lt;option value="1">Option 1&lt;/option>
  351. &lt;option value="2">Option 2&lt;/option>
  352. &lt;option value="3">Option 3&lt;/option>
  353. &lt;/select>
  354. &lt;label>Browser Select&lt;/label>
  355. &lt;select class="browser-default">
  356. &lt;option value="" disabled selected>Choose your option&lt;/option>
  357. &lt;option value="1">Option 1&lt;/option>
  358. &lt;option value="2">Option 2&lt;/option>
  359. &lt;option value="3">Option 3&lt;/option>
  360. &lt;/select>
  361. </code></pre>
  362. </div>
  363. <div class="col s12">
  364. <br><br>
  365. <h4>Disabled Styles</h4>
  366. <p>You can also add <code class="language-markup">disabled</code> to the select element to make the whole thing disabled. Or if you add <code class="language-markup">disabled</code> to the options, the individual options will be unselectable. </p>
  367. </div>
  368. <form class="col s12 m6">
  369. <div class="row">
  370. <div class="col s12">
  371. <label>Materialize Disabled</label>
  372. <select disabled>
  373. <option value="" disabled selected>Choose your option</option>
  374. <option value="1">Option 1</option>
  375. <option value="2">Option 2</option>
  376. <option value="3">Option 3</option>
  377. </select>
  378. <label>Browser Disabled</label>
  379. <select class="browser-default" disabled>
  380. <option value="" disabled selected>Choose your option</option>
  381. <option value="1">Option 1</option>
  382. <option value="2">Option 2</option>
  383. <option value="3">Option 3</option>
  384. </select>
  385. </div>
  386. </div>
  387. </form>
  388. <div class="col s12">
  389. <pre><code class="language-markup">
  390. &lt;label>Materialize Disabled&lt;/label>
  391. &lt;select disabled>
  392. &lt;option value="" disabled selected>Choose your option&lt;/option>
  393. &lt;option value="1">Option 1&lt;/option>
  394. &lt;option value="2">Option 2&lt;/option>
  395. &lt;option value="3">Option 3&lt;/option>
  396. &lt;/select>
  397. &lt;label>Browser Disabled&lt;/label>
  398. &lt;select class="browser-default" disabled>
  399. &lt;option value="" disabled selected>Choose your option&lt;/option>
  400. &lt;option value="1">Option 1&lt;/option>
  401. &lt;option value="2">Option 2&lt;/option>
  402. &lt;option value="3">Option 3&lt;/option>
  403. &lt;/select>
  404. </code></pre>
  405. </div>
  406. <div class="col s12">
  407. <h4>Initialization</h4>
  408. <p>You must initialize the select element as shown below. In addition, you will need a separate call for any dynamically generated select elements your page generates.</p>
  409. <pre><code class="language-javascript col s12">
  410. $(document).ready(function() {
  411. $('select').material_select();
  412. });
  413. </code></pre>
  414. </div>
  415. <div class="col s12">
  416. <h4>Updating/Destroying Select</h4>
  417. <p>If you want to update the items inside the select, just rerun the initialization code from above after editing the original select. Or you can destroy the material select with this function below, and create a new select altogether</p>
  418. <pre><code class="language-javascript">
  419. $('select').material_select('destroy');
  420. </code></pre>
  421. </div>
  422. </div>
  423. </div>
  424. <div id="radio" class="section scrollspy">
  425. <h2 class="header">Radio Buttons</h2>
  426. <p>Radio Buttons are used when the user must make only one selection out of a group of items</p>
  427. <form action="#">
  428. <p>
  429. <input name="group1" type="radio" id="test1" checked />
  430. <label for="test1">Red</label>
  431. </p>
  432. <p>
  433. <input name="group1" type="radio" id="test2" />
  434. <label for="test2">Yellow</label>
  435. </p>
  436. <p>
  437. <input class="with-gap" name="group1" type="radio" id="test3" />
  438. <label for="test3">Green</label>
  439. </p>
  440. <p>
  441. <input name="group1" type="radio" id="test4" disabled="disabled" />
  442. <label for="test4">Brown</label>
  443. </p>
  444. </form>
  445. <p>Add radio buttons to a group by adding the name attribute along with the same corresponding value for each of the radio buttons in the group. Create disabled radio buttons by adding the disabled attribute as shown below.</p>
  446. <pre><code class="language-markup">
  447. &lt;form action="#">
  448. &lt;p>
  449. &lt;input name="group1" type="radio" id="test1" />
  450. &lt;label for="test1">Red&lt;/label>
  451. &lt;/p>
  452. &lt;p>
  453. &lt;input name="group1" type="radio" id="test2" />
  454. &lt;label for="test2">Yellow&lt;/label>
  455. &lt;/p>
  456. &lt;p>
  457. &lt;input class="with-gap" name="group1" type="radio" id="test3" />
  458. &lt;label for="test3">Green&lt;/label>
  459. &lt;/p>
  460. &lt;p>
  461. &lt;input name="group1" type="radio" id="test4" disabled="disabled" />
  462. &lt;label for="test4">Brown&lt;/label>
  463. &lt;/p>
  464. &lt;/form>
  465. </code></pre>
  466. <h4>Options</h4>
  467. <p>To create a radio button with a gap, add <code class="language-markup">class="with-gap"</code> to your input. See the example below.</p>
  468. <p>
  469. <input class="with-gap" name="group3" type="radio" id="test5" checked />
  470. <label for="test5">Red</label>
  471. </p>
  472. <pre><code class="language-markup">
  473. &lt;p>
  474. &lt;input class="with-gap" name="group3" type="radio" id="test5" checked />
  475. &lt;label for="test5">Red&lt;/label>
  476. &lt;/p>
  477. </code></pre>
  478. </div>
  479. <!-- Checkboxes -->
  480. <div id="checkbox" class="section scrollspy">
  481. <h2 class="header">Checkboxes</h2>
  482. <p>Checkboxes</p>
  483. <form action="#">
  484. <p>
  485. <input type="checkbox" id="test9" />
  486. <label for="test9">Red</label>
  487. </p>
  488. <p>
  489. <input type="checkbox" id="test6" checked="checked" />
  490. <label for="test6">Yellow</label>
  491. </p>
  492. <p>
  493. <input type="checkbox" class="filled-in" id="filled-in-box" checked="checked" />
  494. <label for="filled-in-box">Filled in</label>
  495. </p>
  496. <p>
  497. <input type="checkbox" id="indeterminate-checkbox" />
  498. <label for="indeterminate-checkbox">Indeterminate Style</label>
  499. </p>
  500. <p>
  501. <input type="checkbox" id="test7" checked="checked" disabled="disabled" />
  502. <label for="test7">Green</label>
  503. </p>
  504. <p>
  505. <input type="checkbox" id="test8" disabled="disabled" />
  506. <label for="test8">Brown</label>
  507. </p>
  508. </form>
  509. <pre><code class="language-markup">
  510. &lt;form action="#">
  511. &lt;p>
  512. &lt;input type="checkbox" id="test5" />
  513. &lt;label for="test5">Red&lt;/label>
  514. &lt;/p>
  515. &lt;p>
  516. &lt;input type="checkbox" id="test6" checked="checked" />
  517. &lt;label for="test6">Yellow&lt;/label>
  518. &lt;/p>
  519. &lt;p>
  520. &lt;input type="checkbox" class="filled-in" id="filled-in-box" checked="checked" />
  521. &lt;label for="filled-in-box">Filled in&lt;/label>
  522. &lt;/p>
  523. &lt;p>
  524. &lt;input type="checkbox" id="test7" checked="checked" disabled="disabled" />
  525. &lt;label for="test7">Green&lt;/label>
  526. &lt;/p>
  527. &lt;p>
  528. &lt;input type="checkbox" id="test8" disabled="disabled" />
  529. &lt;label for="test8">Brown&lt;/label>
  530. &lt;/p>
  531. &lt;/form>
  532. </code></pre>
  533. </div>
  534. <!-- Switches -->
  535. <div id="switches" class="section scrollspy">
  536. <h2 class="header">Switches</h2>
  537. <form action="#">
  538. <p>
  539. <div class="switch">
  540. <label>
  541. Off
  542. <input checked type="checkbox">
  543. <span class="lever"></span>
  544. On
  545. </label>
  546. </div>
  547. </p>
  548. <p>
  549. <div class="switch">
  550. <label>
  551. Off
  552. <input disabled type="checkbox">
  553. <span class="lever"></span>
  554. On
  555. </label>
  556. </div>
  557. </p>
  558. </form>
  559. <pre><code class="language-markup">
  560. &lt;!-- Switch -->
  561. &lt;div class="switch">
  562. &lt;label>
  563. Off
  564. &lt;input type="checkbox">
  565. &lt;span class="lever">&lt;/span>
  566. On
  567. &lt;/label>
  568. &lt;/div>
  569. &lt;!-- Disabled Switch -->
  570. &lt;div class="switch">
  571. &lt;label>
  572. Off
  573. &lt;input disabled type="checkbox">
  574. &lt;span class="lever">&lt;/span>
  575. On
  576. &lt;/label>
  577. &lt;/div>
  578. </code></pre>
  579. </div>
  580. <div id="file" class="section scrollspy">
  581. <h2 class="header">File Input</h2>
  582. <p>If you want to style an input button with a path input we provide this structure.</p>
  583. <form action="#">
  584. <div class="file-field input-field">
  585. <input class="file-path validate" type="text"/>
  586. <div class="btn">
  587. <span>File</span>
  588. <input type="file" />
  589. </div>
  590. </div>
  591. </form>
  592. <pre><code class="language-markup">
  593. &lt;form action="#">
  594. &lt;div class="file-field input-field">
  595. &lt;input class="file-path validate" type="text"/>
  596. &lt;div class="btn">
  597. &lt;span>File&lt;/span>
  598. &lt;input type="file" />
  599. &lt;/div>
  600. &lt;/div>
  601. &lt;/form>
  602. </code></pre>
  603. </div>
  604. <div id="range" class="section scrollspy">
  605. <h2 class="header">Range</h2>
  606. <p>Add a range slider for values with a wide range. This one is set to be a number between 0 and 100.</p>
  607. <form action="#">
  608. <p class="range-field">
  609. <input type="range" name="points" min="0" max="100">
  610. </p>
  611. </form>
  612. <pre><code class="language-markup">
  613. &lt;form action="#">
  614. &lt;p class="range-field">
  615. &lt;input type="range" id="test5" min="0" max="100" />
  616. &lt;/p>
  617. &lt;/form>
  618. </code></pre>
  619. </div>
  620. <div id="date-picker" class="section scrollspy">
  621. <h2 class="header">Date Picker</h2>
  622. <p>We use a modified version of pickadate.js to create a materialized date picker. Test it out below! </p>
  623. <label for="birthdate">Birthdate</label>
  624. <input id="birthdate" type="text" class="datepicker"></input>
  625. <pre><code class="language-markup">
  626. &lt;input type="date" class="datepicker">
  627. </code></pre>
  628. <h4>Initialization</h4>
  629. <p>At this time, not all pickadate.js options are working with our implementation</p>
  630. <pre><code class="language-javascript">
  631. $('.datepicker').pickadate({
  632. selectMonths: true, // Creates a dropdown to control month
  633. selectYears: 15 // Creates a dropdown of 15 years to control year
  634. });
  635. </code></pre>
  636. </div>
  637. <div id="character-counter" class="section scrollspy">
  638. <h2 class="header">Character Counter</h2>
  639. <p class="caption">Use a character counter in fields where a character restriction is in place.</p>
  640. <div class="row">
  641. <form class="col s12">
  642. <div class="row">
  643. <div class="input-field col s6">
  644. <input id="input_text" type="text" length="10">
  645. <label for="input_text">Input text</label>
  646. </div>
  647. </div>
  648. <br/>
  649. <div class="row">
  650. <div class="input-field col s12">
  651. <textarea id="textarea1" class="materialize-textarea" length="120"></textarea>
  652. <label for="textarea1">Textarea</label>
  653. </div>
  654. </div>
  655. </form>
  656. </div>
  657. <pre><code class="language-markup">
  658. &lt;div class="row">
  659. &lt;form class="col s12">
  660. &lt;div class="row">
  661. &lt;div class="input-field col s6">
  662. &lt;input id="input_text" type="text" length="10">
  663. &lt;label for="input_text">Input text&lt;/label>
  664. &lt;/div>
  665. &lt;/div>
  666. &lt;div class="row">
  667. &lt;div class="input-field col s12">
  668. &lt;textarea id="textarea1" class="materialize-textarea" length="120">&lt;/textarea>
  669. &lt;label for="textarea1">Textarea&lt;/label>
  670. &lt;/div>
  671. &lt;/div>
  672. &lt;/form>
  673. &lt;/div>
  674. </code></pre>
  675. <br>
  676. </div>
  677. </div>
  678. <div class="col hide-on-small-only m3 l2">
  679. <div class="toc-wrapper">
  680. <div class="buysellads hide-on-small-only">
  681. <!-- CarbonAds Zone Code -->
  682. <script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=materializecss" id="_carbonads_js"></script>
  683. </div>
  684. <div style="height: 1px;">
  685. <ul class="section table-of-contents">
  686. <li><a href="#input">Input Fields</a></li>
  687. <li><a href="#textarea">Textareas</a></li>
  688. <li><a href="#select">Select</a></li>
  689. <li><a href="#radio">Radio Buttons</a></li>
  690. <li><a href="#checkbox">Checkboxes</a></li>
  691. <li><a href="#switches">Switches</a></li>
  692. <li><a href="#file">File Input Button</a></li>
  693. <li><a href="#range">Range</a></li>
  694. <li><a href="#date-picker">Date Picker</a></li>
  695. <li><a href="#character-counter">Character Counter</a></li>
  696. </ul>
  697. </div>
  698. </div>
  699. </div>
  700. </div>
  701. </div>
  702. </main> <footer class="page-footer">
  703. <div class="container">
  704. <div class="row">
  705. <div class="col l4 s12">
  706. <h5 class="white-text">Help Materialize Grow</h5>
  707. <p class="grey-text text-lighten-4">We are a team of college students working on this project like it's our full time job. Any amount would help support and continue development on this project and is greatly appreciated.</p>
  708. <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
  709. <input type="hidden" name="cmd" value="_s-xclick">
  710. <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----
  711. ">
  712. <button class="btn waves-effect waves-light red lighten-3" type="submit" name="action" alt="PayPal - The safer, easier way to pay online!">Donate Now
  713. </button>
  714. </form>
  715. </div>
  716. <div class="col l4 s12">
  717. <h5 class="white-text">Join the Discussion</h5>
  718. <p class="grey-text text-lighten-4">We have a gitter chat room set up where you can talk directly with us. Come in and discuss new features, future goals, general problems or questions, or anything else you can think of.</p>
  719. <a class="btn waves-effect waves-light red lighten-3" target="_blank" href="https://gitter.im/Dogfalo/materialize">Chat</a>
  720. </div>
  721. <div class="col l4 s12" style="overflow: hidden;">
  722. <h5 class="white-text">Connect</h5>
  723. <iframe src="http://ghbtns.com/github-btn.html?user=dogfalo&repo=materialize&type=watch&count=true&size=large" allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe>
  724. <br>
  725. <a href="https://twitter.com/MaterializeCSS" class="twitter-follow-button" data-show-count="true" data-size="large" data-dnt="true">Follow @MaterializeCSS</a>
  726. <br>
  727. <div class="g-follow" data-annotation="bubble" data-height="24" data-href="https://plus.google.com/108619793845925798422" data-rel="publisher"></div>
  728. </div>
  729. </div>
  730. </div>
  731. <div class="footer-copyright">
  732. <div class="container">
  733. © 2014-2015 Materialize, All rights reserved.
  734. <a class="grey-text text-lighten-4 right" href="https://github.com/Dogfalo/materialize/blob/master/LICENSE">MIT License</a>
  735. </div>
  736. </div>
  737. </footer>
  738. <!-- Scripts-->
  739. <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
  740. <script>if (!window.jQuery) { document.write('<script src="bin/jquery-2.1.1.min.js"><\/script>'); }
  741. </script>
  742. <script src="js/jquery.timeago.min.js"></script>
  743. <script src="js/prism.js"></script>
  744. <script src="bin/materialize.js"></script>
  745. <script src="js/init.js"></script>
  746. <!-- Twitter Button -->
  747. <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
  748. <!-- Google Plus Button-->
  749. <script src="https://apis.google.com/js/platform.js" async defer></script>
  750. <!-- Google Analytics -->
  751. <script>
  752. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  753. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  754. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  755. })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  756. ga('create', 'UA-56218128-1', 'auto');
  757. ga('require', 'displayfeatures');
  758. ga('send', 'pageview');
  759. </script>
  760. </body>
  761. </html>