How to populate today’s date using JQuery in SharePoint

Advertisement
In this article we are able to see how to get the todays date based on condition from another column when we click on save button using JQuery

We are having a requirement with Stats Column with drop down  option, if the status column is in Completed then when we click on the save button it will display the todays date on Date column filed.

function PreSaveAction()
{
if ($("select[Title='Status'] option:Selected").val() == 'Completed') {
var date = new Date();
var datinformat = date.getMonth()+1 + "/" + date.getDate() + "/" + date.getFullYear();
$("input[title = 'DateField']").val(datinformat);
}
else
{
$("input[title = 'DateField']").val("");

}

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM
Advertisements
SHARE

Unknown

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a comment