Easy Tutorial
❮ Dom Obj Document Prop Style Marginleft ❯

Input Date required Attribute

Input Date Object

Example

Check if the date field is a required field before form submission:


Definition and Usage

The required attribute is used to set or return whether the date field is mandatory before form submission.

This attribute reflects the HTML required attribute.


Browser Support

All major browsers support the required attribute, except Safari and Internet Explorer 9 and earlier versions.

Note: Internet Explorer and Firefox do not support the <input type="date"> element.


Syntax

Return the required attribute:

Set the required attribute:

Attribute Values

Value Description
true false Describes whether the date field is a required field in the form. true - The date field is a required field in the form<br>false - Default. The date field is not a required field in the form

Technical Details

| Return Value: | Boolean, returns true if the date field is a required field in the form, otherwise returns false | | --- | --- |


More Examples

Example

Set the date field as a required part of the form:


Related Pages

HTML Reference: HTML <input> required Attribute


❮ Dom Obj Document Prop Style Marginleft ❯