Rules with Readonly Checkboxes

Forums Dynamic Forms for SharePoint Rules with Readonly Checkboxes

This topic contains 7 replies, has 3 voices, and was last updated by  Alexander Bautz 2 months, 2 weeks ago.

  • Author
  • #8255



    I wrote a rule that made a checkbox field readonly. I assumed it would leave the checkbox selections visible and just disable them so they could not be checked or unchecked. But instead the whole field disappeared. Is that how it is supposed to work?

    And a related question, is it possible through DFFS rules to make specific checkbox choices readonly, but leave others available, within the same column?


  • #8265

    Alexander Bautz

    Using a readonly representation of a checkbox field makes sense, I have therefore added this to the upcoming release.

    Your other request will however not be added as default functionality, but you can add this custom code to achieve it.

    Add this to the “Run these functions / trigger these rules” in the rule:


    Then add this to the Custom JS textarea in the “Field table, Custom JS and CSS” tab:

    function readonlyCheckbox(){
    		if(spjs.$(c).next().text() === "Blue"){

    Change “Color” to your field internal name and “Blue” to the option you want to set as readonly.


  • #24485

    Andreas Blüher

    Hello Alexander,

    I found this thread because I stumbled up on the same issue. Although using a quiet new version checkboxes are still being removed instead of being disabled.

    Is it still required to use the script or should it be included in the latest release?

    Kind Regards,

  • #24490

    Alexander Bautz

    This was added back in 2015 – can you show me some screenshots so I can see how it looks in your form?

    PS: If it is in DispForm, you will have to use a custom script like this:

    function showCheckboxesInDispForm(fin) {
            "url": _spPageContextInfo.webServerRelativeUrl + "/_api/web/lists/getbyid('" + _spPageContextInfo.pageListId + "')/fields/getByInternalNameOrTitle('" + fin + "')",
            "method": "GET",
            "headers": { "Accept": "application/json; odata=verbose" },
            "success": function (data) {
                var arr = data.d.Choices.results, b = [], currentChoicesArr = getFieldValue(fin).split("; ");
                jQuery.each(arr, function (i, c) {
                    var checked = jQuery.inArray(c, currentChoicesArr) > -1;
                    b.push("<span class='ms-RadioText' title='" + c + "'><input type='checkbox'" + (checked ? " checked='checked'" : "") + " disabled><label>" + c + "</label></span>");
                jQuery("#dffs_" + fin + "").html(b.join("<br>"));
            "error": function (data) {
                console.log("Error getting field choices:");
    showCheckboxesInDispForm("ToDo"); // Call with the FieldInternalName of the field


  • #24515

    Andreas Blüher

    I wasn’t honest about the “almost latest version”. I’m using

    DFFS frontend:
    DFFS frontend CSS: 4.44 /
    Autocomplete: 1.6.22
    Cascading dropdowns: 3.7.22
    jQuery: 1.12.4
    Lookup: 1.1.11
    Resource management: not loaded
    SPJS-Utility: 1.323
    vLookup: 2.2.122

    So as you can see the checkbox is visible in my EditForm and after setting the boolean field to be readonly the checkbox is set to display:none;

    I’m sorry if I’m missing something obvious here.

    Cheers Andreas

  • #24525

    Alexander Bautz

    The problem is that the readonly checkbox icon is the same color as you have chosen as form background color. You must override the default color by adding this to your custom css:

    .dffs-readonly-inner *{


  • #24533

    Andreas Blüher

    Thank you for your help, I feel stupid but it was very unfortunate that my customer did choose the same color for their background :O

  • #24535

    Alexander Bautz

    No problem, I’m glad we figured it out.


You must be logged in to reply to this topic.