Working with tabs/accordions? Want to add buttons to let the user go back and forth to different pages? You can do this by simply setting the selectedIndex on the tab/accordion. Assuming your accordion has the name accordion1, this button will send you to page 1.
Obviously if you want to go from page 3 to page 2, selectedIndex would be set to 1. You could probably rewrite this to sniff the current active page and just set it to a value one less.
In fact, I shouldn't be so lazy. Here is the "proper" version:
Obviously a "Next" button would be slightly different.


Comment 1 written by Bradford on 7 March 2005, at 11:17 AM
Comment 2 written by Raymond Camden on 7 March 2005, at 11:18 AM
Comment 3 written by Andy Allan on 7 March 2005, at 11:37 AM
Comment 4 written by Bradford on 7 March 2005, at 12:44 PM
Comment 5 written by phill.nacelli on 7 March 2005, at 12:47 PM
<cfinput type="button" name="step2A" value="Next" onClick="accordion1.getHeaderAt(selectedIndex+1).enabled=true;accordion1.selectedIndex=accordion1.selectedIndex+1" />
Comment 6 written by Raymond Camden on 7 March 2005, at 12:55 PM
Comment 7 written by Ben Densmore on 29 March 2005, at 4:59 PM
Thanks,
Ben
Comment 8 written by Ben Densmore on 29 March 2005, at 5:06 PM
Ben
Comment 9 written by Ray Camden on 29 March 2005, at 5:42 PM
Comment 10 written by Chris on 6 January 2006, at 10:27 AM
Comment 11 written by Jonas on 30 July 2006, at 5:55 AM
Comment 12 written by Rod Kesselring on 4 December 2006, at 8:41 AM
[Add Comment] [Subscribe to Comments]