web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Set or Auto populate value in Date Field - CRM Portal

Arpit Shrivastava Profile Picture Arpit Shrivastava 7,518 User Group Leader
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


  1. $(document).ready(function(){
  2. var roundTripFormat = "YYYY-MM-DDTHH:mm:ss.0000000\\Z";
  3. var input = $("#AppointmentStartDate");
  4. var date = moment("06/28/2017").utc();
  5. input.val(date.format(roundTripFormat));
  6. input.siblings(".datetimepicker").data("datetimepicker").setValue(date);
  7. });


Also, if you want to perform some actions or operations on 'onchange'  event of Date field, you can achieve it through below syntax:

  1. $(document).ready(function(){
  2. var input = $("#AppointmentStartDate");
  3. input.siblings(".datetimepicker").data("datetimepicker").change(function(){ alert("Date has been changed."); });
  4. });

This was originally posted here.

Comments

*This post is locked for comments