Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

[feature request] form elements #272

Open
vdegenne opened this issue May 29, 2018 · 0 comments
Open

[feature request] form elements #272

vdegenne opened this issue May 29, 2018 · 0 comments

Comments

@vdegenne
Copy link

A native form element provides the elements property which contains a list of all the elements in the form (input, select, ...). However one would expect to use paper-input or other web-components that Polymer provides. elements of a native form element ignores tags that it doesn't know so for instance, this :

<iron-form>
  <form id="myForm">
    <paper-input name="firstname" label="firstname"></paper-input>
    <paper-input name="lastname" label="lastname"></paper-input>
    <input type="hidden" name="id" value="1">
  </form>
</iron-form>

<script>
  console.log(window.myForm.elements); // only contains the native hidden type input (id)
</script>

That'd be great if one could do :

<iron-form id="mySuperForm">
  <form>
    <paper-input name="firstname" label="firstname"></paper-input>
    <paper-input name="lastname" label="lastname"></paper-input>
    <input type="hidden" name="id" value="1">
  </form>
</iron-form>

<script>
  console.log(window.mySuperForm.elements); // returns all the three elements (firstname, lastname, id)
</script>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant