- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2020 11:28 AM
Hi all,
I have a widget on a Service Portal page that uses fill out. One of the fields is a date field. I want the field to auto populate with "todays" date. Below is the code that I have, but not sure how to get the date field to auto populate.
<label for="dateRequested">Date of Request:</label>
<input type="date" id="dateRequested" ng-required="data.dateRequested" ng-model="data.dateRequested">
Solved! Go to Solution.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2020 12:26 PM
Hi,
Why don't you use sp_date_picker directive.
<sp-date-picker ng-model="your.model.value" sn-change="your_function()"></sp-date-picker>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2020 11:33 AM
Hi,
Can you try with this logic
<input type="date" id="dateRequested" ng-required="data.dateRequested" ng-model="new Date()">
if my response helps you please hit or mark as correct answer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2020 12:09 PM
Shantharao,
I tried the code but it did not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2020 12:33 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2020 12:26 PM
Hi,
Why don't you use sp_date_picker directive.
<sp-date-picker ng-model="your.model.value" sn-change="your_function()"></sp-date-picker>