Hiding a field based on contents of SP Checkboxes

I am attempting to hide a fields value on a form is a specific value is present in the checkbox values of a SharePoint field. I cannot seem to find the means to accomplish this. Can someone send me in the right direction on how to add this code please?

Thank you,
Ben

Dear Ben,
Here is the code that will check if something is present in the Checkboxes field and if there is something - it will hide Title field. This triggers on form load and when Checkboxes field has any change:

fd.spRendered(function() {

    function hideOrShowFields() {
        if (fd.field('Checkboxes').value.indexOf("Enter Choice #1") >= 0) {
            // Hide the Title field
            $(fd.field('Title').$parent.$el).hide();
        } else {
            // Show the Title field
            $(fd.field('Title').$parent.$el).show();
        }
    }

    // Calling hideOrShowFields when the user changes the Start Date
    fd.field('Checkboxes').$on('change',hideOrShowFields);

    // Calling hideOrShowFields on form loading
    hideOrShowFields();

});

The code is taken from this article, and slightly modified to fit your case better. You can still find more information in the article.

1 Like

Thank you! This solved my issue perfectly!

1 Like