Stacey Fontenot
asked on
Check for date value in input field, else return default date
I have an MVC C# Application. On the cshtml page, i have a date input field. Sometimes the user leaves it blank and sometimes fills it in. I need to evaluate whether the field is blank or not in the controller. If it is blank, I would like to insert a default value of '01/02/1901'. I'm using html 5.
input code is below:
input code is below:
<input type="date" name="Date Worked" id="add_Date_Worked" class="form-control" required />
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Open in new window
Regards,
Pratik