Search code examples
polymerpolymer-1.0paper-elements

Using paper-icon-button as input button to submit a form


I am trying to use paper-icon-button as input button to submit a form.

<form method="POST" action="self">
   <paper-icon-button icon="star" extends="input" name="favourite" noscript></paper-icon-button>
   <input type="hidden" name="hiddenId" value="1"/>                 
   <input type="hidden" is="favourite">
</form>

This doesn't seem to be submitting the form.

What am I doing wrong here?

Thanks in advance.


Solution

  • to also resolve field validation issues "required",

    The best would be to use this property :

    function submitForm(event) {
        Polymer.dom(event).localTarget.parentElement.submit();
    }
    

    And not to forget the attribute "is" in the < form > tag :

    <form is="iron-form" method="POST" action="self">
    

    More information : iron-form