added hidden field for selected accordion tab
This commit is contained in:
parent
ea40d3b796
commit
a804f94d6f
|
@ -3816,10 +3816,16 @@ class htmlAccordion extends htmlElement {
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
}
|
}
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
$hiddenIndexId = $this->id . "_index";
|
||||||
|
echo '<input type="hidden" name="' . $hiddenIndexId . '" id="' . $hiddenIndexId . '" value="' . $active . '">';
|
||||||
$script = 'jQuery(function() {
|
$script = 'jQuery(function() {
|
||||||
$( "#' . $this->id . '" ).accordion({
|
$( "#' . $this->id . '" ).accordion({
|
||||||
collapsible: ' . $collapsible . ',
|
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);
|
$js = new htmlJavaScript($script);
|
||||||
|
|
Loading…
Reference in New Issue