Expand Accordion
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Sure, here is a sample:
$('#fd_accordion-0 > h3:eq(1)').click()
Please, replace the highlighted number with the index of the section which you need to collapse/expand.
$('#fd_accordion-0 > h3:eq(1)').click()
Please, replace the highlighted number with the index of the section which you need to collapse/expand.
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";}
Thank you, but more specific requirement is below:
If answer to question A is “Yes”, expand the accordion.
If answer to question A is “No”, collapse the accordion.
Can I retrieve the current state of an accordion item?
/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";}
Thank you, but more specific requirement is below:
If answer to question A is “Yes”, expand the accordion.
If answer to question A is “No”, collapse the accordion.
Can I retrieve the current state of an accordion item?
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Please, set Mode property of the Accordion to SingleCollapsable in Forms Designer and put the following code into JS-editor:
Replace the highlighted text with the internal name of your Yes/No column.
Code: Select all
function toggleSection() {
var section = $('#fd_accordion-0 > h3:eq(0)');
if (fd.field('YesNo').value()) {
if (!section.hasClass('ui-state-active')) {
section.click();
}
} else {
if (section.hasClass('ui-state-active')) {
section.click();
}
}
}
fd.field('YesNo').change(toggleSection);
toggleSection();
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Sure, here is a sample:
Code: Select all
function toggleTabs(){
var disabledTabs = [];
if (fd.field('Field1').value()) {
disabledTabs.push(1);
}
if (fd.field('Field2').value()) {
disabledTabs.push(2);
}
if (fd.field('Field3').value()) {
disabledTabs.push(3);
}
$('#fd_tabcontrol-0').tabs('option', 'active', 0);
$('#fd_tabcontrol-0').tabs('option', 'disabled', disabledTabs);
}
fd.field('Field1').change(toggleTabs);
fd.field('Field2').change(toggleTabs);
fd.field('Field3').change(toggleTabs);
toggleTabs();
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
-
- Information
-
Who is online
Users browsing this forum: No registered users and 7 guests