The title pretty much asks the question. I have a form that is empty when it opens. There is an input on it that has the required
attribute. However for some reason HTML is applying the :invalid
pseudoclass to this empty input before the user touches the field. Can anyone name some reasons why that might be happening? I put breakpoints into my validation functions and none of them are executed at load time.
Before anyone asks, it isn't really possible to post code for this. I'm really just looking for a few possible reasons to get started with debugging it.
Thanks in advance
The HTML required
attribute in the <input>
tag specifies that an input field must be filled in before submitting the form. Removing this attribute should solve your problem. I think HTML mark-up is rather permissive there shouldn't be much debugging to it.
It's preferrable to use a validation service such as the W3C Validation Service