Link to home
Start Free TrialLog in
Avatar of Stacey Fontenot
Stacey Fontenot

asked on

Check if Date Input Field has value, if not add a default

I have a web application that is using html 5. I need to check a date input field to see if it has a value, if not, then add then add the date: (1901-01-01) yyyy-MM-dd. I would like to use javascript. The input date field is below.

html code ----------------------------------------------------------------------
<input type="date" name="Date_First_Use" id="add_Date_First_Use" class="form-control" disabled />

Open in new window

Avatar of Zakaria Acharki
Zakaria Acharki
Flag of Morocco image

Based on which event you want to perform the check, after some specific action or on DOM load...
Avatar of Stacey Fontenot
Stacey Fontenot

ASKER

I plan to complete after the submit button is pushed. If the value is empty, add the default.
ASKER CERTIFIED SOLUTION
Avatar of Zakaria Acharki
Zakaria Acharki
Flag of Morocco image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
excellent