diff --git a/horizontal-tabs/horizontal-tabs.js b/horizontal-tabs/horizontal-tabs.js index 977e1b6..da5a5e4 100644 --- a/horizontal-tabs/horizontal-tabs.js +++ b/horizontal-tabs/horizontal-tabs.js @@ -119,6 +119,11 @@ Drupal.horizontalTab.prototype = { .siblings(':hidden.horizontal-tabs-active-tab') .val(this.fieldset.attr('id')); this.item.addClass('selected'); + //append the tab anchor to the action of the form to preserve state + formaction = $('form').attr('action'); + var hashind = formaction.indexOf("#"); + var newaction = formaction.substring(0,hashind)+"#"+$(this.fieldset).attr('id'); + $('form').attr('action',newaction); // Mark the active tab for screen readers. $('#active-horizontal-tab').remove(); this.link.append('' + Drupal.t('(active tab)') + '');