{"id":15022326,"url":"https://github.com/polymerelements/iron-form","last_synced_at":"2025-07-08T07:16:31.737Z","repository":{"id":31950639,"uuid":"35520464","full_name":"PolymerElements/iron-form","owner":"PolymerElements","description":"Custom form element","archived":true,"fork":false,"pushed_at":"2023-10-16T14:02:54.000Z","size":602,"stargazers_count":63,"open_issues_count":46,"forks_count":81,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-12-25T00:05:37.260Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.webcomponents.org/element/PolymerElements/iron-form","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PolymerElements.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-13T01:01:02.000Z","updated_at":"2024-12-19T07:13:00.000Z","dependencies_parsed_at":"2024-06-18T13:32:21.932Z","dependency_job_id":"51065b05-208f-42d3-9e41-5f29c0f01f1c","html_url":"https://github.com/PolymerElements/iron-form","commit_stats":{"total_commits":289,"total_committers":44,"mean_commits":6.568181818181818,"dds":0.7162629757785467,"last_synced_commit":"672120bf1f88e57ef772bfbf3a992b1439b347ff"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PolymerElements","download_url":"https://codeload.github.com/PolymerElements/iron-form/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231164529,"owners_count":18337351,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T19:57:47.924Z","updated_at":"2024-12-25T00:05:42.252Z","avatar_url":"https://github.com/PolymerElements.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Published on NPM](https://img.shields.io/npm/v/@polymer/iron-form.svg)](https://www.npmjs.com/package/@polymer/iron-form)\n[![Build status](https://travis-ci.org/PolymerElements/iron-form.svg?branch=master)](https://travis-ci.org/PolymerElements/iron-form)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://webcomponents.org/element/@polymer/iron-form)\n\n\n## \u0026lt;iron-form\u0026gt;\n`\u003ciron-form\u003e` is a wrapper around the HTML `\u003cform\u003e` element, that can\nvalidate and submit both custom and native HTML elements.\n\nIt has two modes: if `allow-redirect` is true, then after the form submission you\nwill be redirected to the server response. Otherwise, if it is false, it will\nuse an `iron-ajax` element to submit the form contents to the server.\n\nSee: [Documentation](https://www.webcomponents.org/element/@polymer/iron-form),\n  [Demo](https://www.webcomponents.org/element/@polymer/iron-form/demo/demo/index.html).\n\n## Usage\n\n### Installation\n```\nnpm install --save @polymer/iron-form\n```\n\n### In an html file\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript type=\"module\"\u003e\n      import '@polymer/iron-form/iron-form.js';\n      import '@polymer/paper-checkbox/paper-checkbox.js';\n    \u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003ciron-form\u003e\n      \u003cform method=\"get\" action=\"/form/handler\"\u003e\n        \u003cinput type=\"text\" name=\"name\" value=\"Batman\"\u003e\n        \u003cinput type=\"checkbox\" name=\"donuts\" checked\u003e I like donuts\u003cbr\u003e\n        \u003cpaper-checkbox name=\"cheese\" value=\"yes\" checked\u003e\u003c/paper-checkbox\u003e\n      \u003c/form\u003e\n    \u003c/iron-form\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\nBy default, a native `\u003cbutton\u003e` element (or `input type=\"submit\"`) will submit this form.\nHowever, if you want to submit it from a custom element's click handler, you need to explicitly\ncall the `iron-form`'s `submit` method:\n\n```html\n  \u003cpaper-button raised onclick=\"submitForm()\"\u003eSubmit\u003c/paper-button\u003e\n\n  function submitForm() {\n    document.getElementById('iron-form').submit();\n  }\n```\n\n### In a Polymer 3 element\n```js\nimport {PolymerElement, html} from '@polymer/polymer';\nimport '@polymer/iron-form/iron-form.js';\nimport '@polymer/paper-checkbox/paper-checkbox.js';\n\nclass SampleElement extends PolymerElement {\n  static get template() {\n    return html`\n    \u003ciron-form\u003e\n      \u003cform method=\"get\" action=\"/form/handler\"\u003e\n        \u003cinput type=\"text\" name=\"name\" value=\"Batman\"\u003e\n        \u003cinput type=\"checkbox\" name=\"donuts\" checked\u003e I like donuts\u003cbr\u003e\n        \u003cpaper-checkbox name=\"cheese\" value=\"yes\" checked\u003e\u003c/paper-checkbox\u003e\n      \u003c/form\u003e\n    \u003c/iron-form\u003e\n    `;\n  }\n}\ncustomElements.define('sample-element', SampleElement);\n```\n\n## Contributing\nIf you want to send a PR to this element, here are\nthe instructions for running the tests and demo locally:\n\n### Installation\n```sh\ngit clone https://github.com/PolymerElements/iron-form\ncd iron-form\nnpm install\nnpm install -g polymer-cli\n```\n\n### Running the demo locally\n```sh\npolymer serve --npm\nopen http://127.0.0.1:\u003cport\u003e/demo/\n```\n\n### Running the tests\n```sh\npolymer test --npm\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymerelements%2Firon-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolymerelements%2Firon-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymerelements%2Firon-form/lists"}