diff --git a/lam/lib/html.inc b/lam/lib/html.inc
index 3fd87278..648d619a 100644
--- a/lam/lib/html.inc
+++ b/lam/lib/html.inc
@@ -3816,10 +3816,16 @@ class htmlAccordion extends htmlElement {
echo '';
}
echo '';
+ $hiddenIndexId = $this->id . "_index";
+ echo '';
$script = 'jQuery(function() {
$( "#' . $this->id . '" ).accordion({
collapsible: ' . $collapsible . ',
- active: ' . $active . '
+ active: ' . $active . ',
+ activate: function( event, ui ) {
+ var newOption = jQuery("#' . $this->id . '").accordion( "option", "active" );
+ jQuery("#' . $this->id . '_index").val(newOption);
+ }
});
});';
$js = new htmlJavaScript($script);