Page 1 of 1

LookupMulti count selected total

Posted: 26 Jan 2017
by djp81
Hi,

I am using a LookupMulti field, called customers, the left column has the available customers populated from a list,

Is there a way to count the number of customers that have been selected and moved into the right hand column on submit? have tried a few ways with no luck

Thanks

Re: LookupMulti count selected total

Posted: 27 Jan 2017
by Dmitry Kozlov
Hi,

The following code returns the number of selected items:

Code: Select all

fd.field('FieldName').control()._el().find('select:eq(1) option').length
Replace 'FieldName' with the internal name of the lookup field.

Re: LookupMulti count selected total

Posted: 27 Jan 2017
by djp81
Perfect :)

Last question! how would you then search through the selected customers to find a specific one, e.g. if 3 were selected and i needed to know if "Microsoft" was one of the customers?


Thank you

Re: LookupMulti count selected total

Posted: 27 Jan 2017
by djp81
ignore the above, i managed to get it to work :)