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

Question

Question

expand section if field not empty

asked on September 10, 2024 Show version history

I have a form that has sections that are collapsed on the first stage. If the user desires, they can open it up and complete the table ( with 20 rows) within the section if they have common items to order. Below is a partial snip.

I need to have it open by default on Stage 2 if the quantity is not empty.

Is there a was to do this?

 

0 0

Replies

replied on September 10, 2024 Show version history

As it is right now in the new designer, there is not a way to do this programmatically or in field rules. I already have a work item to explore this feature further. Thanks for providing a use case!

1 0
replied on September 11, 2024

Hi Mary Lou,

Yeah there is no out of the box solution, but you could probably do this with javascript.  One way it could work is to put a hidden field in your table, called 'Count' in the following example.  In that you could put =COUNTIF(Table.Qty, "> 0")  choosing your table name instead of table of course.  This will only put a number in there if the qty is not null or 0.  Then create a number field outside of the table which can also be hidden, in the case below it is just called 'Number'.  In this field give it the class 'qtyChecker' and under the advanced tab calculation box =MAX(Table.Count).  Now all you have to do is reference that in the javascript to look for a value greater than zero to expand the section.  You could use an IF statement and say if that number field is greater than zero then run the following statement:

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

 

Just substitute your field number in place of the q14.

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

Sign in to reply to this post.