Forums

Add a "next" button to a panel (solved)

kaejai 28 Mar, 2012
I am using the latest chronoforms 4 (4.0 RC3.21) in Joomla 2.5.

I have created a form called "frm_tab" to which I've added 1 pane called "form_pane".
To "form_pane" I added 3 panels called "panel1" & "panel2" & "panel3".

In each panel I added a custom button with the following: onclick="displayPanel(1)" where the variable is the integer value of the next panel (zero based the panels above are 0, 1 and 2 respectively).

I added a Load JS event in the On Load of the form and in that I wrote the following function:

function displayPanel(num)
{
var pane = $('form_pane').retrieve('JTabs');
pane.display(num);
}

I then ammended the /media/system/js/tabs.js file as described in this joomla forum post: http://forum.joomla.org/viewtopic.php?p=1618497 - which advised to put this code at the end of the initialize function:

this.dlist = $(dlist);
this.dlist.store('JTabs',this);

This works. However, if anyone knows of a better solution please post it here, thanks!
ProgrammerJen 19 Aug, 2012
I've attempted to set this up on one of my forms. But it's not directing to the correct tab, and I'm seeing this error in firebug: pane is null

Any suggestions?
GreyHead 27 Aug, 2012
Hi ProgrammerJen,

I just worked through this and added it to this FAQ - caution: code hack required. The code in the FAQ is for Joomla! 2.5.6 earlier versions may differ.

Bob
This topic is locked and no more replies can be posted.