Hide/show field on display form

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
cmagnan
Posts: 23
Joined: Fri Jan 26, 2018

30 Jan 2018

Hi,
I am having some difficulty to adapt the code for the display form. If the field 'TransferredDevelopementLog' is checked (Yes/No field) the field 'DevelopementRequestID' (hyperlink field) should be enable, if not it should be disable. I know that I need to used the _el() method, but I don't know where.
******************
function setHideTransferredDevelopmentLog() {

var v = fd.field('TransferredDevelopementLog').control().value();
if (fd.field('TransferredDevelopementLog').value()) {
$('.DevelopementRequestID-Link').show(); // Enable
} else {
$('.DevelopementRequestID-Link').hide(); // Disable
}
}

// Subscribe on status change
fd.field('TransferredDevelopementLog').control().change(function () {
setHideTransferredDevelopmentLog();
});

// Initialize
setHideTransferredDevelopmentLog();
*******************
Can you help me.
Thanks.

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

02 Feb 2018

Dear cmagnan,
You can simply try to use this, it should work on Display Form as well:

Code: Select all

if (fd.field("YesNo").value() == "Yes"){
    //do something
}
else if (fd.field("YesNo").value() == "No"){
    //do something else
}
Cheers

cmagnan
Posts: 23
Joined: Fri Jan 26, 2018

02 Feb 2018

Thanks a lot Nikita

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests