Accordion Expand

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
ksertkaya
Posts: 87
Joined: Wed Nov 18, 2015

18 Nov 2015

Hello,

I have an accordion in form. When I open this form, all tabs expand except first tab. How do I expand first tab when I open this form?
http://prntscr.com/941zcf

Here's my current code:

$('#fd_accordion-0 > h3:eq(0)').click()
$('#fd_accordion-0 > h3:eq(1)').click()
$('#fd_accordion-0 > h3:eq(2)').click()
$('#fd_accordion-0 > h3:eq(3)').click()
$('#fd_accordion-0 > h3:eq(4)').click()

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

18 Nov 2015

Hi!

You have 4 tabs in the accordion, but are trying to expand 5. The last line in fact initiates a click on the first tab. Remove the last line and you'll be fine.

ksertkaya
Posts: 87
Joined: Wed Nov 18, 2015

18 Nov 2015

Hi,

Fifth tab doesn't seem in that picture
http://prntscr.com/944add

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

18 Nov 2015

Show the code that you're using with that accordion.

ksertkaya
Posts: 87
Joined: Wed Nov 18, 2015

18 Nov 2015

I use just that code for accordion. Do I have to use another code for accordion?

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

18 Nov 2015

OK, this is happening because one of the tabs (in this case - the first one) is opened by default, so what you're doing is closing it. Probably best you just set which tabs are opened by default in Forms Designer. Go to Forms Designer, select the accordion, look to the right, you'll see the "Expanded" field. Enumerate here all your tabs, starting from 0, like this:

0,1,2,3,4

ksertkaya
Posts: 87
Joined: Wed Nov 18, 2015

18 Nov 2015

Thank you very much rostislav !

lijupnandanan
Posts: 16
Joined: Mon Apr 11, 2016

19 Apr 2016

Hi,
By default when I cleck new form , The first accordion tab will be expanded. i need to collapse every tab on New form and need to expand only when I clicked the tab. how can I resolve this?
I added this on Page load
$('#fd_accordion-0 > h3:eq(0)').click()

But its not working

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

19 Apr 2016

Open the designer, select the Accordion, and clear the Expanded property. Then clear cookies.

lijupnandanan
Posts: 16
Joined: Mon Apr 11, 2016

19 Apr 2016

Still Not working. I didnt enter any tab index on Expanded property an I cleared the cookies.
Issues on
1. Click New form expand first tab and then click cancel button.
2. Again click New form , Now the first tab is expanded without clicking on it.
But when we collapsed all tab and click cance button and again click new form all tabs are in collapsable. Thats the issue

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests