Forms: add pattern & title to input
While implementing custom widget to handle form validation on Hubl, I landed on the conclusion that almost all of them could by solved by using pattern
& title
attribute.
I would like to have some simple form validation this way:
<solid-form
fields="username"
pattern-username="[a-z0-9]{3,12}"
title-username="3 à 12 lettres en minuscules ou chiffres">
</solid-form>
Which would generate this:
<input name="username" type="text" [...] pattern="[a-z0-9]{3,12}" title="3 à 12 lettres en minuscules ou chiffres">
<span></span>
The span
allow to add a text or anything else based on the input validity. It should not have a default style.