I have been seen so many people asking a way to auto populate and set value in Portal Date field.Today In this article I am going to share a way to achieve the same.
Here is Adxstudio Community thread where lot of people were asking and facing challenge to set the value in Portal Date field :
https://community.adxstudio.com/forums/adxstudio-portals/76204747-a17d-e511-80dd-000d3a10150a
- $(document).ready(function(){
- var roundTripFormat = \”YYYY-MM-DDTHH:mm:ss.0000000\\\\Z\”;
- var input = $(\”#AppointmentStartDate\”);
- var date = moment(\”06/28/2017\”).utc();
- input.val(date.format(roundTripFormat));
- input.siblings(\”.datetimepicker\”).data(\”datetimepicker\”).setValue(date);
- });
Also, if you want to perform some actions or operations on \’onchange\’ event of Date field, you can achieve it through below syntax:
- $(document).ready(function(){
- var input = $(\”#AppointmentStartDate\”);
- input.siblings(\”.datetimepicker\”).data(\”datetimepicker\”).change(function(){ alert(\”Date has been changed.\”); });
- });
Like this:
Like Loading...
Related
Published by arpitpowerguide
My name is Arpit Shrivastava, who is a Microsoft MVP in the Business Applications category. I am a Microsoft Dynamics 365 and Power Platform enthusiast person who is having a passion for researching and learning new things and acquiring immense knowledge. I am providing consistent help, support, and sharing my knowledge through various Social Media Channels along with my Personal Blog, Microsoft Community, conducting online training and attending various 365 Saturday Events worldwide and sharing the best Solutions to the readers helping them achieve their goals and objectives in Customer Relationship Space.
View more posts
This code is not working for the current version of portalthe below is the error i am getting TypeError: $(…).siblings(…).data(…) is undefined
LikeLike
This is not working for me as well. Nothing gets set and I tried setting the date with different ways but nothing is working for me.
LikeLike
I was able to get this working with the following kind of thing:var yourDate = \”2020-04-22T17:28:00.0000000Z\”;var yourDateNormal = \”4/22/2020\”;$(\”#datefield\”).val(yourDate);$(\”[aria-describedby='datefield_description']\”).val(yourDateNormal);
LikeLike
This worked for me as well. Thanks a bunch!!
LikeLike
Special thanks to (hackingsetting50@gmail.com) for exposing my cheating husband. Right with me i got a lot of evidences and proofs that shows that my husband is a fuck boy and as well a cheater ranging from his text messages, call logs, whats-app messages, deleted messages and many more, All thanks to (hackingsetting50@gmail.com), if not for him i will never know what has been going on for a long time. Contact him now and thank me later.
LikeLike
Special thanks to (hackingsetting50@gmail.com) for exposing my cheating husband. Right with me i got a lot of evidences and proofs that shows that my husband is a fuck boy and as well a cheater ranging from his text messages, call logs, whats-app messages, deleted messages and many more, All thanks to (hackingsetting50@gmail.com), if not for him i will never know what has been going on for a long time. Contact him now and thank me later.
LikeLike