Page 1 of 1

Customizing A Calendar Form

Posted: 30 Aug 2019
by MarionSmith
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');

Re: Customizing A Calendar Form

Posted: 02 Sep 2019
by mnikitina
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.

Re: Customizing A Calendar Form

Posted: 03 Sep 2019
by smithme
Thank you this worked perfectly.