Is this along the lines of what you're trying to do? This is a result of a key feature of Shadow DOM: Encapsulation. The elements in your polymer-element's template are not in the main document, and as such, are not available via document.getElementById()
and the like.
You could instead call this.shadowRoot.getElementById()
and it would work because this
inside of your polymer-element's prototype is linked to the host element. Or even better, take advantage of the amazing features Polymer gives you for free. Polymer exposes this.$
to polymer-elements, which contains a key for every element in your template that has an ID! No method call needed, just use this.$.myForm.submit()
. Here's the final jsbin.