AnsweredAssumed Answered

Dynamic multi choice field in Repeating Sections

Question asked by brad@bradoverton.com on Apr 22, 2016
Latest reply on May 17, 2016 by cju@evolusys.ch

Hello All,

 

Hoping someone can point me in the right direction for this.   I have a form with a multi-text field that holds all possible values (separated by semicolons)  to be selected in a multi choice field in a repeating section.  Let's say it holds all the States.    What I want is for all the State values to be selected in the repeating sections.   So the first repeating section multi choice field would show all 50 states.   Let's say the user picks 10 states and then adds a new repeating section row.   That new row would have only the remaining 40 states in it's multi choice field.  This would continue until all states are selected across "X" number of repeating rows.    My thought was to have two  fields one with original 50 states and one with the selected states.   I would use an "Row Adding" or "Row Deleting" event to keep the running list of selected states and compare the two fields and come up with the remaining list which would be used in the new row's multi choice field.  (Maybe this is a third field)     So in theory this sounds awesome and totally do-able.   My issue is I'm not sure how to pull it off.    I have the events wired up to my repeating section and working to give alerts when new rows are added or deleted.   I just don't have enough experience to know how to get the values from the multi-choice field in the repeating rows to do the running list and do the comparison.     I would appreciate any advice or some similar examples of the JavaScript to help me figure it out.   

 

**Extra bonus points for validating all 50 states are selected

 

Thank you in advance,

Brad

 

Ps- I've seen some great posts that helped me with the events, thanks Caroline Jung for pointing it out to me,  and Emily Billing for creating it.

Outcomes