Hiding elements

Hello
I have a tabbed form, on one of these tabs are repeat groups.
There are four field elements in the repeat group

house_boat_93_repeat___fore_aft_centre_a
house_boat_93_repeat___fore_aft_centre_b
house_boat_93_repeat___fore_aft_centre_c
house_boat_93_repeat___fore_aft_centre_d

I want to hide one of the fields elements on load, but only on the first repeat.
I have placed this code in the inline javascript section of an element which is not on a repeat group.
JavaScript:
hideInputFields(this);

Then in form_X.js I have this

JavaScript:
function hideInputFields(el){
             var elem = 'house_boat_93_repeat___fore_aft_centre_a_0';
             console.log("hide this element: ",elem);
             el.form.formElements.get(elem).hide();
              }

What happens is that 'house_boat_93_repeat___fore_aft_centre_d' is hidden on all rows and 'house_boat_93_repeat___fore_aft_centre_a' is still visible

I am unsure if I am using the wrong approach or have made a mistake?
 
Last edited:
The code looks OK, although I would delay running the function till Fabrik has finished loading:

Have you tried putting a breakpoint in your code, and poking around?

-- hugh
 
Hello
I placed some break points in, but didn't really see anything, however I am only an amateur.

I did however create a new database, new table and form with and 2 groups, 2 field elements on each.

This allowed me to make the following observations.

When the group repeat template is set to table, it hides the element that is closest to the fabrik group repeater buttons, no matter what element name I use and on every new repeat group opened.

When the group repeat template is set to list, it hides the correct element but on every repeat, rather than just the first one.

Setting the form template to either bootstrap or bootstrap-tabs has no effect.

I'm not quite sure what to try next?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top