LookupMulti count selected total

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
djp81
Posts: 4
Joined: Thu Jan 26, 2017

26 Jan 2017

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

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

27 Jan 2017

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.

djp81
Posts: 4
Joined: Thu Jan 26, 2017

27 Jan 2017

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

djp81
Posts: 4
Joined: Thu Jan 26, 2017

27 Jan 2017

ignore the above, i managed to get it to work :)

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests