Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
.github/ | 03-May-2024 | - | 34 | 14 | ||
demo/ | 03-May-2024 | - | 317 | 271 | ||
test/ | 03-May-2024 | - | 947 | 817 | ||
.bower.json | D | 03-May-2024 | 2.8 KiB | 78 | 78 | |
.gitignore | D | 03-May-2024 | 31 | 3 | 2 | |
.travis.yml | D | 03-May-2024 | 1.8 KiB | 27 | 26 | |
CONTRIBUTING.md | D | 03-May-2024 | 3.4 KiB | 78 | 39 | |
README.md | D | 03-May-2024 | 1.6 KiB | 53 | 28 | |
bower.json | D | 03-May-2024 | 2.6 KiB | 70 | 69 | |
index.html | D | 03-May-2024 | 987 | 31 | 14 | |
iron-form.html | D | 03-May-2024 | 16.1 KiB | 463 | 336 |
README.md
1 2<!--- 3 4This README is automatically generated from the comments in these files: 5iron-form.html 6 7Edit those files, and our readme bot will duplicate them over here! 8Edit this file, and the bot will squash your changes :) 9 10The bot does some handling of markdown. Please file a bug if it does the wrong 11thing! https://github.com/PolymerLabs/tedium/issues 12 13--> 14 15[![Build status](https://travis-ci.org/PolymerElements/iron-form.svg?branch=master)](https://travis-ci.org/PolymerElements/iron-form) 16 17_[Demo and API docs](https://elements.polymer-project.org/elements/iron-form)_ 18 19 20## <iron-form> 21`<iron-form>` is a wrapper around the HTML `<form>` element, that can 22validate and submit both custom and native HTML elements. 23 24It has two modes: if `allow-redirect` is true, then after the form submission you 25will be redirected to the server response. Otherwise, if it is false, it will 26use an `iron-ajax` element to submit the form contents to the server. 27 28 Example: 29 30```html 31 <iron-form> 32 <form method="get" action="/form/handler"> 33 <input type="text" name="name" value="Batman"> 34 <input type="checkbox" name="donuts" checked> I like donuts<br> 35 <paper-checkbox name="cheese" value="yes" checked></paper-checkbox> 36 </form> 37 </iron-form> 38``` 39 40By default, a native `<button>` element (or `input type="submit"`) will submit this form. However, if you 41want to submit it from a custom element's click handler, you need to explicitly 42call the `iron-form`'s `submit` method. 43 44 Example: 45 46```html 47 <paper-button raised onclick="submitForm()">Submit</paper-button> 48 49 function submitForm() { 50 document.getElementById('iron-form').submit(); 51 } 52``` 53