HTML Guide
The type dob
is not valid for an input
. If you want to build a date picker field, you can use the native HTML input elements with type date
, datetime-local
, or a generic text
input decorated with JavaScript and CSS.
In HTML, the type
attribute for the <input>
element specifies the type of input control that is to be displayed. The type
attribute can have values like text
, password
, email
, date
, etc. Using an unsupported or invalid value like dob
(which presumably stands for “date of birth”) will cause this validation error.
Here’s an example of how you can correct this issue by using a supported type
attribute value for the date of birth input:
<label for="dob">Date of Birth:</label>
<input type="date" id="dob" name="dob">
In this corrected example, we’ve used the type="date"
attribute value for the date of birth input. This is a valid type for handling dates in HTML forms. Replace the input type with a supported type according to the specific data you need to capture.
Alternatively you can use a JavaScript library to build a date picker on a generic text
input. For example, the popular bootstrap-datepicker library will generate a date picker around a text
input.
Learn more:
Related W3C validator issues
The maxlength attribute can be used on an input element to define a client-side validation for the maximum length allowed on an input without resorting to JavaScript.
This attribute is only allowed on elements of type email, password, search, tel, text, or url.
The minlength attribute can be used on an input element to define a client-side validation for the maximum length allowed on an input without resorting to JavaScript.
This attribute is only allowed on elements of type email, password, search, tel, text, or url.
The minlength attribute defines the minimum number of characters (as UTF-16 code units) the user can enter into an <input> or <textarea>. This must be an integer value 0 or higher. If no minlength is specified, or an invalid value is specified, the input has no minimum length. This value must be less than or equal to the value of maxlength, otherwise the value will never be valid, as it is impossible to meet both criteria.
Here’s an example:
<label for="name">Enter your name (max 25 characters)</label>
<input type="text" minlength="25" id="name">
The pattern attribute is only allowed on input whose type is email, password, search, tel, text or url. Check the type used, and consider changing to one of the allowed types to enable pattern client-side validation.
The pattern attribute is a handy way of adding client-side validation on HTML forms without resorting to JavaScript. Check out this article to learn more about Input Pattern.
The boolean required attribute can only be used with certain types of inputs. Check the input type is one of the allowed.
The required attribute, if present, indicates that the user must specify a value for the input before the owning form can be submitted.
The name attribute is required for all input elements.
The value tel-national cannot be used on the attribute autocomplete of an <input> element of type tel. Either change to type="text", or use autocomplete="tel". Examples:
<!-- Using autocomplete "tel-national" on type "tel" is invalid -->
<input name="phone1" type="tel" autocomplete="tel-national" />
<!--Using autocomplete "tel-national" on type "text" is valid -->
<input name="phone2" type="text" autocomplete="tel-national" />
<!--Using autocomplete "tel" on type "tel" is valid -->
<input name="phone3" type="tel" autocomplete="tel" />
The value provided on the type attribute of an a element is not a valid MIME type.
The type attribute expects a MIME type that hints at the linked URL’s format.
The type attribute on <a> elements, when present, gives a hint on the MIME type of the linked resource, for example:
<a href="application/pdf" src="book.pdf">Read our book</a>
<a href="image/jpeg" src="photo.jpeg">See a photo</a>
That is, we’re talking about the type of the linked resource, not the type of the <a> element, as it’s sometimes misunderstood. The following example is invalid because button is not a valid MIME type.
<a href="/order.php" type="button">Submit</a>
The value used to define the type of a link is not valid. You’re probably using a URL instead of a valid type.
Example of a valid type:
<link rel="icon" type="image/png" href="favicon.png">
input elements can be of different types but zip is not one of the allowed. Consider using a generic type like text instead.