When a form is submitted, user agents must act as if they used the following algorithm. First, each element in that form's
elementslist is added to a temporary list (note that theelementslist is defined to be in document order). Then, each element in this list whosewillValidateDOM attribute is true is checked for validity, and aninvalidevent must be fired on each element that, when checked, is found to fail to comply with its constraints (i.e. each element whosevalidity.validDOM attribute is false) and is still a member of the form after the event has been handled.