Having issues hiding a sbs label

Forums Dynamic Forms for SharePoint Having issues hiding a sbs label

This topic contains 3 replies, has 2 voices, and was last updated by  becca 3 months, 4 weeks ago.

  • Author
    Posts
  • #25386

    becca
    Participant

    I’ve tried half about a million things, but nothing will hide the label. I know I have the right IDs since I’ve inspected and added “display:none;” to the potential elements and it’s worked correctly, I just can’t get it into my code in a way that works. The less outlandish things I’ve tried are

    
    
    $("#sbs_OuterTR_888").hide();
    $("#sbs_OuterTR_888").addClass('spjshidden');
    $("#sbs_customLabel_888").hide();
    $("#sbs_customLabel_888").addClass('spjshidden');
    $("#888").hide();
    $("#888").addClass('spjshidden');
    $("888").hide();
    $("888").addClass('spjshidden');
    document.getElementById('sbs_OuterTR_888').style.display='none';
    document.getElementById('888').style.display='none';

    I’ve also done a bunch of weird stuff with adding “dffs_”/”sbs_”/”#” to the front and “.sbs_OuterTR”/”.ms-formlabel” to the end and still nothing has worked. I’m not sure what else I can try at this point.

  • #25403

    becca
    Participant

    sbs_OuterTR_888 does work in rules, while I’m not fond of this solution I have a rule to show the element sbs_OuterTR_888 and one to hide it that I trigger from js at different points. Seems extra odd to me that it works as it should in a rule but not $(“#sbs_OuterTR_888”).hide();

  • #25406

    Alexander Bautz
    Keymaster

    The problem is that the side-by-side html is generated on load / change of the tabs. Your Custom JS is trying to hide it before it is actually constructed. This means you must either run this function every time you load this tab, or if you want to permanently hide it, use Custom CSS like this:

    #sbs_OuterTR_888{
        display:none!important;
    }

    Alexander

  • #25428

    becca
    Participant

    Okay, so to use it the way I want I would have to put the first reference to the sbs in a function dffs_ready(){} before continuing with my code. That makes a lot of sense since with my rules solution I have to use dffs_ready with my first reference to the rule. This actually helps me understand dffs as a whole a bit better, thanks a ton.

You must be logged in to reply to this topic.