Customizing A Calendar Form

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
MarionSmith
Posts: 1
Joined: Fri Aug 30, 2019

30 Aug 2019

I am attempting to do two things.

1) I want to always set the "All Day" boolean (checkbox) to true.

2) I want to fill the Title field with the text value of a SharePoint lookup field (not a Cross Site Lookup control).

Should I do both of these things on the onsubmit handler? What would the code look like?

This is what I have:

Code: Select all

fd.field('OnCall').change(function(){
	fd.field('Title').value(fd.field("OnCall").value());
});

fd.field('fAllDayEvent').value('1');

User avatar
mnikitina
Posts: 264
Joined: Wed Jun 05, 2019

02 Sep 2019

Hello MarionSmith,

Please use the below code to set Title with lookup text and 'All Day Event' to true on form load.

Code: Select all

fd.field('OnCall').change(function(){
	fd.field('Title').value(fd.field('OnCall').control('getSelectedText'));
});

fd.field('fAllDayEvent').control()._el().find('input').attr('checked', true);
If you need to set fields value on form save, please use this code under onsubmit(handler).

You can find more details in 'Getting and setting SharePoint form field values' and 'Manager' articles.

User avatar
smithme
Posts: 45
Joined: Wed Jul 26, 2017

03 Sep 2019

Thank you this worked perfectly.
City of Nampa
Idaho
United States of America

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests