How to hide element in form?

jfquestiaux

Well-Known Member
I have a form with 4 groups.
In the first group, I have a googlemap element - named "geocode" - that I wish to hide in the form view but not in the detailed view.
There used to be a code in the Wiki (for fabrik 2) to do that but I can't find it anymore (the page says "use the following code", but the code is gone). So I cloned the default template and addes this in the default_group.php file

Code:
<?php foreach ($this->elements as $element) {
    if( $element->id != 'artists_details___geocode' ) {
    ?>
   ... the default code ...
} ?>

This works fine if all the groups are on the same page or even with the tab template.
But if I put the page break to have a multi-page form (which is what I need), I am stuck on page 1 (I have the "validate" wheel, then I am stuck on page 1).
It might be normal behavior but then how can I hide this element on the multi-page form?
 
May be the element's HTML id is needed.

I think you can hide it with custom css, e.g.
#form_X .googlemap {display:none}
 
can you point us at the page as well, perhaps its a js error due to the element not being there but the js code expecting it to be there.
 
Custom_css.php shouldn't be a problem, can you post your code (maybe a typo)?
BTW: you still can use custom.css
 
Could you turn on Fabrik debug and point us at the page please?
That would give me move of an idea where the issue is. thx
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top