1

I have a field with multiple checkbox options that is shared across multiple different content types. I need to keep the column as-is but also filter so that only certain checkboxes show based upon the content type.

As an example.

  • Site column choice with checkboxes, title='Fruits'
  • 'Fruits' values='Apples, Oranges, Pears, Peaches, Pineapple'
  • Content types = North, South, West

New form is OOTB to select content type

  • If Content type='North' then column 'Fruits' should only show 'Oranges, Pineapple' checkboxes
  • If Content type='South' then column 'Fruits' should only show 'Pears, Peaches' etc.

I found another thread but it addressed drop-downs. It also didn't work for me to target my content types, otherwise this is what I want to do: Different sets of options in a lookup or choice column depending on the content type

Changing this column into multiple columns is not an option unfortunately.

0

Unless you create your own URL to NewForm.aspx without parameters, the ContentTypeId is by default present as a QueryString parameter.

So you can add some JavaScript to that single NewForm.aspx that matches by ContentTypeId and hide values

   JSRequest.EnsureSetup();
    var ctID=JSRequest.QueryString['ContentTypeId'];
    var titles={
        '0x0100.. ContentTypeID' : 'North',
        '0x0100.. ContentTypeID' : 'South',
    '0x0100.. ContentTypeID' : 'West'
    };
    var title = titles[ctID] || ctID;
   if(title=='North')
    {
        if($('#ControlID').closest('tr').find('table tr input[type="checkbox"]').closest(".ms-RadioText[title='Apples']").hide()
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.