How hide/show Groups using JS?

F.schettino

Italian
I need hide/show Groups depending on situations.

I know how hide/show an element
Fabrik.getBlock('form_x').elements.get('table___element').hide();​

How to hide/show a Group?

Thanks in advance.
 
You can use element javascript settings. It affects also groups if you need so. Depending on this element value some other element or group could be shown or hidden
 
If you go to Fabrik -> Elements -> Javascript.

You are able to use the predefined setup to display or hide a group or element depending on the value placed in that element.

Works quite well.
 
You don't need any special fabrik magic to hide and show groups (or elements, come to that). Just use standard J! selectors. Inspect your page source to find out the ID of the container for the group, which will usually be a fieldset with an id like groupXX, where XX is the numeric group ID, and do ...

Code:
document.id('group123').hide();

... or show().

The only reason we typically advise people to get element objects from the Fabrik block is they usually need to do "other stuff" to the Fabrik object(s). But for simple hide/show, you just operate on the DOM element directly.

-- hugh
 
Sorry to be so crassly commercial, but the plummeting Euro / US$ exchange rate is killing me, as we bill in Euro's but I live in the US. So where I used to be able to spend at least a little time answering Community issues, I've taken about a 30% pay cut in the last few months ... so I'm having to encourage more Community folk to chip in with at least a Standard sub if they need support.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top