From a804f94d6f70514b803ba72ec44ba48211d1ed4e Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 21 Oct 2018 10:08:17 +0200 Subject: [PATCH] added hidden field for selected accordion tab --- lam/lib/html.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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);