Page 1 of 1

Hide/show field on display form

Posted: 30 Jan 2018
by cmagnan
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.

Re: Hide/show field on display form

Posted: 02 Feb 2018
by Nikita Kurguzov
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
}

Re: Hide/show field on display form

Posted: 02 Feb 2018
by cmagnan
Thanks a lot Nikita