Hide group tabs based on checkbox element

futuron

Member
Hi,

I have a form with several groups (divided in tabs). In the fist group there is a checkbox element called DAY.
When i click on one of the days i want to show the tab with the day (so monday, tuesday etc).

I've set several options DAY element in the JAVASCRIPT TAB
(also looked at this post: http://fabrikar.com/forums/index.ph...function-in-front-end-list.40642/#post-204472 but that didn't help/work)

What does 'work' is
on load : When element "DAY" is shown, hide group "FIRDAY"
but the tab stays visable just the elements are hidden.
Besides that i can't get it to toggle on/off.

Hope someone can help me out with this.
-Luc
 
I've done this for you on the site.

Here's the JavaScript code I added to the days element for both an onload and onclick

JavaScript:
var days = Fabrik.getBlock('form_1').elements.fab_artiesten___dag.getValue();
 
 
for (var i = 3; i < 9; i++) {
  document.id('group' + i + '_tab').hide();  
}
 
if (days !== undefined) {
for (i= 0; i < days.length; i ++) {
  switch(days[i]) {
    case 'vr' : 
      document.id('group3_tab').show();  
      break;
    case 'za' : 
      document.id('group4_tab').show();  
      break;
    case 'zo' : 
      document.id('group5_tab').show();  
      break;
    case 'ma' : 
      document.id('group6_tab').show();  
      break;
    case 'di' : 
      document.id('group7_tab').show();  
      break;
    case 'wo' : 
      document.id('group8_tab').show();  
      break;
  }
}
}
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top