We're using Plumsail HelpDesk deployed to on-premise SharePoint Server 2019. We would like the table highlighted in the screenshot below to be hidden whenever the Status field is different than 'Draft'.
fd.spRendered(() => {
function hideShowSubmit() {
if (fd.field('Status').value !== 'Draft') {
// hide
$('.table-submit').hide();
} else {
//show
$('.table-submit').show();
}
}
// Calling hideShowSubmit when the Status field value changes
fd.field('Status').$on('change',hideShowSubmit);
// Calling hideShowSubmit on form loading
hideShowSubmit();
});
Hi @Evgeniy , thank you for the detailed response. The code you shared did not work and when I check the browser console, it says "fd.spRendered is not a function". I did a little research for this error in the Plumsail Community and people were saying this command does not work in Forms Designer application. See screenshot of the error:
Please try the code below, it is based on this solution.
function hideShowSubmit() {
if (fd.field('Status').value() != 'Draft') {
// hide
$('.table-submit').hide();
} else {
//show
$('.table-submit').show();
}
}
// Calling hideShowSubmit when the user changes the status
fd.field('Status').change(hideShowSubmit);
// Calling hideShowSubmit on form loading
hideShowSubmit();