Pre Populating a date field

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
jpwallace
Posts: 47
Joined: Fri Mar 03, 2017

26 Apr 2017

Hi guys,

I have got my form to pre populate the logged on user using...
// Load current user login
SP.SOD.executeOrDelayUntilScriptLoaded((function () {
var ctx = new SP.ClientContext.get_current();
var web = ctx.get_web();
ctx.load(web);
var user = web.get_currentUser();
user.retrieve();
ctx.executeQueryAsync(
function () {
// Set user login
fd.field('Customer').control().value(user.get_loginName());
// Run validation by emulating validation image click
fd.field('Customer').control()._el().find('a:eq(0)').click();
});
}), "SP.js");

This works fine, is there a similar script to populate a date field, I have tried in SP list settings and set "Todays Date" as the default but it just shows up as a blank field??

Cheers

John

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

26 Apr 2017


Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests