I am trying to learn HTML5 and came across the following. I would like to use the pattern input keyword to validate the input as the user types it (e.g. validation after pressing tab or changing focus from input box).
I have tried the following:
<input name="variable" value="" tabindex="1" maxlength="13" required="required" pattern="${expectedValue}" onchange="this.variable.validate()" /> </li>
And as well:
<input name="variable" value="" tabindex="1" maxlength="13" required="required" pattern="${expectedValue}" /> </li>
I made up the code for
onchange="this.variable.validate()"
How to trigger the validation on value change? I am able to do this only onSubmit.