• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Show/hide group with js

bea

Active Member
Hi again,
forget the old post, because there is a new situation:

I've 4 elements:
elB = fab_cp1_line_tour___security_status (dropdown, value 1,2 and 3 | 3= show group)
elC = fab_cp1_line_tour___security_checks (checkboxes, value 1,2,3 and 4 | minimum one not checked=show group)
elD = fab_cp1_line_tour___security_incidents (int field | >=1 show group)
elE = fab_cp1_line_tour___security_nearmiss (int field | >=1 show group)

Group 9 with one element is hidden by default.
The script doesn't work, because I did it wrong...

Many thanks in advance.
Bianka


JavaScript:
function hidecomment_sec(el){
   var form = Fabrik.getBlock('form_1');
   if (form === false) {
      form = Fabrik.getBlock('details_1');
   }

  if (form === false) {
    return;
   }

   var elA = el.form.formElements.get('fab_cp1_line_tour___security_comment');
   var elB = el.form.formElements.get('fab_cp1_line_tour___security_status');
   var elC = el.form.formElements.get('fab_cp1_line_tour___security_checks');
   var elD = el.form.formElements.get('fab_cp1_line_tour___security_incidents');
   var elE = el.form.formElements.get('fab_cp1_line_tour___security_nearmiss');

   if((elB.getValue().toInt()=='3')
          ||
        (elC.getValue().toInt()!='["1","2","3","4"]')
        ||
        (elD.getValue().toInt()>='1')
        ||
        (elE.getValue().toInt()>='1')
        ){
      jQuery('#group9').show();
     return;
   }

     if((elB.getValue().toInt()<'3')
         ||
        (elC.getValue().toInt()=='["1","2","3","4"]')
        ||
        (elD.getValue().toInt()<'1')
        ||
        (elE.getValue().toInt()<'1')
    
        ){
      jQuery('#group9').hide();
      return;
   }
   else{
      jQuery('#group9').hide();
   }
}
 
Last edited:
Hi,
without Element C (checkbox) the script works inside the form, but not detailed.
Would be nice to get a hint ;)
Cheers
Bianka
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top