Using a simple form like that, how to watch if it can be submitted?
<form action="/action_page.php">
  <label for="country_code">Country code:</label>
  <input type="text" id="country_code" name="country_code"
  pattern="[A-Za-z]{3}" title="Three letter country code"><br><br>
  <input type="submit">
</form>
I mean, if some inputs are using pattern and / or required, how to know if the whole form is ok to be submitted?
I’ve found the oninvalid attribute for a specific input. It is possible to use an onvalid on the <form> element?
 
     
    