Is there a way to hide unchecked checkboxes from a multi-relational field?

Hello,

I have a multi-relational field that I'm displaying as checkboxes.

If I select 2 out of 4 in a transition only those two will display on the State form.

If I use another transition to update the field all four checkboxes will show. I only want the two that are selected to show similar to the way its displaying on the state form.

Is there some javascript that will enable me to do this?

Regards,

Will
Parents
  • Will,

    Give this a try.

    Create a form action that fires on load. and have it run a javascript. Put the following in

    var x = $(GetFieldWidgetByName("MyMulti")).find(":checkbox:not(:checked)")
    
    for (i = 0; i
    $(":[title='" x.title "']").hide();
    }


    You may have to add a "\" to part of the code depending on the version of SBM but you will know as you will get a yellow indicator in the javascript screen.

    In the code substitute your multi relational field name where mine is MyMulti

    It's not the most glamorous because all it does is removes the checkboxes but due to the way we coded the multi select boxes it's difficult to get rid of all the artifacts. (See attachment )

    Hope it helps
    Brian
Reply
  • Will,

    Give this a try.

    Create a form action that fires on load. and have it run a javascript. Put the following in

    var x = $(GetFieldWidgetByName("MyMulti")).find(":checkbox:not(:checked)")
    
    for (i = 0; i
    $(":[title='" x.title "']").hide();
    }


    You may have to add a "\" to part of the code depending on the version of SBM but you will know as you will get a yellow indicator in the javascript screen.

    In the code substitute your multi relational field name where mine is MyMulti

    It's not the most glamorous because all it does is removes the checkboxes but due to the way we coded the multi select boxes it's difficult to get rid of all the artifacts. (See attachment )

    Hope it helps
    Brian
Children
No Data