Collapse the form section
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2015 09:02 AM
How can we collapse the form section on load.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2015 06:53 PM
I tried it but it only toggles i.e. sometimes it would display or sometimes it would hide the sections. I wanted a function which can always make the section as of collapsed when the form loads. I am wondering if that is possible .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2015 06:58 PM
Could anyone suggest something over this - Berny Alvarado rfedoruk Steve Bell (Cloud Sherpas) Brad Tilton (Cloud Sherpas)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2015 09:20 PM
Hi snowlearner,
Here is an implementation of what I suggested earlier, with a couple of minor tweaks to check for the sections not being collapse already. This works only on Fuji (because of the shortcut I used to get the sections):
function onLoad() {
var section,sections = g_form.getSections();
for (var i=0; i<sections.length; i++) {
section = sections[i];
if(! ((' ' + section.className + ' ').indexOf(' state-closed ') > -1) )
hideReveal(section.id.substr('section-'.length));
}
}
This is just a small step beyond what was suggested earlier. With a little experimentation and research in your dev console, you should be able to find out how getSections, g_tabs2Sections, and hideReveal work. If you need this on Eureka and earlier, you should be able to extrapolate out what is here and figure out how to do it without the getSections function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2015 06:08 AM
😮 Is line 2 a way to declare a variable and make it equal to something on the same line!?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2015 08:47 AM
Hi Robert,
No, it's declaring 2 variables (section and sections) while setting section equal to undefined and sections equal to the array returned by g_form.getSections();
It's really just so I don't re-declare the section variable each time through the loop.