You are viewing limited content. For full access, please sign in.

Question

Question

Override Section Label Option of Collapse/Expand after form is submitted

asked on October 28, 2016

I'm creating a form that will be submitted to the Print/Mailroom for processing. It's a very lengthy form broken down by collapsed sections. Those completing the form know exactly which section to complete; however, the mailroom needs the specific section that has been completed expanded to know where to look for the information. 

I'd like to keep the sections collapsed when the form is launched so it's easy to complete, but is there a way to override the default collapse/expand after the form is submitted with javascript? 

Thank you for your help!

0 0

Replies

replied on October 28, 2016

Please take a look at this.

$(document).ready(function () {

    $('#q2 .collapsible').trigger('click');

});

 

0 0
replied on October 28, 2016

Thank you, Junaid! That helps so much (and I'm sorry I couldn't find that on my own). 

Follow-up Question -- can you help me with the script to establish a field value match on a checkbox field? For example, using the example from the link you provided to 51029, what's the value for "Eric" when I just want to know if any box is checked? 

Thanks again!

0 0
replied on October 28, 2016

Oh, I may have found it. Will this work? 

   var val = $(this).is(':checked');

with "this" being my section ID? 

0 0
replied on October 28, 2016

Yes. It should.

0 0
replied on November 8, 2016

Hello again, 

I'm having trouble making this work and I think it's because I'm attempting to piece too much (too little?) together. (That, and I don't know enough about javascript.)

What does the javascript look like if I want Field12 (collapsed by default) to automatically expand when Field19 (multi-checkbox field) has any box checked? 

Also, is there a shortcut to make this repeatable? (when Field24 is checked, expand Field15, when Field52 is checked, expand Field34, etc.)

Thank you so much for your (continued!) help! 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.