Did fix for hiding tabs make it into 3.6 ?

Any commits made prior to the date we built 3.6 will be included.

If it came after, we'll be building a 3.6.1 very soon, to fix issues with PDF in PHP 7.

-- hugh
 
Thanks, Hugh. I rechecked my 3.6 installation and it did include the changes from the commit mentioned above. Yea! I didn't botch the upgrade!

Now I just need to figure out why my inline Javascript code for load & click didn't hide the tabs when it successfully hid the corresponding groups ... sigh.

I have 5 radio buttons that show/hide 5 combinations of three tabs . The radio buttons are on a "main" group that stays visible thanks to Hugh for some suggested code changes to the default.php in bootstrap_tabs.

{{{Yes, I know the danger in modifying core Fabrik code, but I hope to mature the changes into a mod that the grownups (i.e., the real developers) might entertain including in Fabrik someday.}}}

But I digress -- I think my code (although verbose) is fairly straight forward. Does anyone out there have any ideas about where I've gone wrong?

Code:
var form = Fabrik.getBlock('form_23');
var table = 'gn_event___';
var buttons = table + 'type';

var choice1 = 'Single Date';
var choice2 = 'Start/End';
var choice3 = 'Start/Duration';
var choice4 = 'Duration/End';
var choice5 = 'Duration';

var group_a = 'group118';
var group_a_tab = 'group118_tab';
var group_b = 'group122';
var group_b_tab = 'group122_tab';
var group_c = 'group121';
var group_c_tab = 'group121_tab';

var chosen = form.elements.get(buttons).getValue();

document.id(group_a).hide();
document.id(group_a_tab).hide();
document.id(group_b).hide();
document.id(group_b_tab).hide();
document.id(group_c).hide();
document.id(group_c_tab).hide();

switch(chosen) {
    case choice1 :
      document.id(group_a).show();
      document.id(group_a_tab).show();
      document.id(group_b).hide();
      document.id(group_b_tab).hide();
      document.id(group_c).hide();
      document.id(group_c_tab).hide();
      break;

    case choice2 :
      document.id(group_a).show();
      document.id(group_a_tab).show();
      document.id(group_b).hide();
      document.id(group_b_tab).hide();
      document.id(group_c).show();
      document.id(group_c_tab).show();
      break;

    case choice3 :
      document.id(group_a).show();
      document.id(group_a_tab).show();
      document.id(group_b).show();
      document.id(group_b_tab).show();
      document.id(group_c).hide();
      document.id(group_c_tab).hide();
      break;

    case choice4 :
      document.id(group_a).hide();
      document.id(group_a_tab).hide();
      document.id(group_b).show();
      document.id(group_b_tab).show();
      document.id(group_c).show();
      document.id(group_c_tab).show();
      break;

    case choice5 :
      document.id(group_a).hide();
      document.id(group_a_tab).hide();
      document.id(group_b).show();
      document.id(group_b_tab).show();
      document.id(group_c).hide();
      document.id(group_c_tab).hide();
      break;
}
 
You don't have to modify core code, just clone the template (copy the whole bootstrap_tabs folder to a new name) and use that. Modify at your pleasure.

-- hugh
 
Well, the KISS principle applied . Here is the "final" code I used. Of course, I will probably continue to fiddle with it. For example, to go back to go "reclick" the tab that was active the last time the chosen combination was in effect. I also hope to generalize the code so that I can use it on other forms if need be.

JavaScript:
var form = Fabrik.getBlock('form_23');
var table = 'gn_event___';
var buttons = table + 'type';

var chosen = form.elements.get(buttons).getValue();

var choice1 = 'Single Date';
var choice2 = 'Start/End';
var choice3 = 'Start/Duration';
var choice4 = 'Duration/End';
var choice5 = 'Duration';

var group_a = '#group118_tab';
var group_b = '#group122_tab';
var group_c = '#group121_tab';

switch(chosen) {
   case choice1 :
      jQuery(group_a).show();
      jQuery(group_b).hide();
      jQuery(group_c).hide();
      jQuery(group_a).trigger('click');
      break;

    case choice2 :
      jQuery(group_a).show();
      jQuery(group_b).hide();
      jQuery(group_c).show();
      jQuery(group_a).trigger('click');
      break;

    case choice3 :
      jQuery(group_a).show();
      jQuery(group_b).show();
      jQuery(group_c).hide();
      jQuery(group_a).trigger('click');
      break;

    case choice4 :
      jQuery(group_a).hide();
      jQuery(group_b).show();
      jQuery(group_c).show();
      jQuery(group_b).trigger('click');
      break;

    case choice5 :
      jQuery(group_a).hide();
      jQuery(group_b).show();
      jQuery(group_c).hide();
      jQuery(group_b).trigger('click');
      break;
}
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top