I'd like to create a custom input element with a custom template and have the native HTML <form>
respect it as it does the other native input elements. For example, when the element is invalid and the user tries to submit the form, the browser would trigger the validation logic on my custom element and prevent submission and show errors. Also, when the form is submitted or serialised, the value of the custom element is included also.
I've gotten as far as using the "is" attribute and a custom class that extends HtmlInputElement
object, but I can't seem to use a custom template using this method.
How can I go about doing this if it's possible?
Examples using plain JavaScript as well as Polymer are welcomed.