Page 1 of 1

Conditional format of fields

Posted: 27 Apr 2016
by rab
Hello, what a graet solution for sharepoint!
I have a small question. I have a very importend field (yes/no field) - I will highlight the field until the field is checked. The field has a own css class (fontsize and bold). Also I have created a additional css style .highlighted which should handle the background color.
In JS editor I have creates a small handler. But it dosn't work. Here is my code: Have you a suggestion?
Thank you
RAB

function entrycompletehandler() {
//var status = fd.field('Title').value();
if (fd.field('Eingang_x0020_vollst_x00e4_ndig').value()) {
fd.field('Eingang_x0020_vollst_x00e4_ndig').control()._el().addClass('highlighted');
}
}
fd.field('Eingang_x0020_vollst_x00e4_ndig').change(function()
{
entrycompletehandler();
});
entrycompletehandler();

Re: Conditional format of fields

Posted: 27 Apr 2016
by Dmitry Kozlov
Hi,

You need to add class to the title of the field:

Code: Select all

function entrycompletehandler() {
	if (fd.field('Eingang_x0020_vollst_x00e4_ndig').value()) {
		fd.field('Eingang_x0020_vollst_x00e4_ndig').title()._el().addClass('highlight');
	} else {
		fd.field('Eingang_x0020_vollst_x00e4_ndig').title()._el().removeClass('highlight');
	}
}
fd.field('Eingang_x0020_vollst_x00e4_ndig').change(function()
{
entrycompletehandler();
});
entrycompletehandler();

Re: Conditional format of fields

Posted: 27 Apr 2016
by rab
Great, it works perfect.

Thank you!