Add property to single text field

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
MARIN
Posts: 2
Joined: Mon Sep 21, 2020

21 Sep 2020

Hi,

It is possible to add the "list" property to a single line text field with Javascript?

At the top of the form I added a HTML control containing a datalist. I would like to bind the ID of the datalist to the field. It should allow the user to choose predefined values from the list but not force it.

User avatar
mnikitina
Posts: 264
Joined: Wed Jun 05, 2019

22 Sep 2020

Hello Marin,

I'm not sure I fully understand your case. Could you please provide more details, some screenshots of the form also would be helpful.

MARIN
Posts: 2
Joined: Mon Sep 21, 2020

23 Sep 2020

Hi,

I finally found the answer myself.

I added a HTML container containing a <datalist id="mydatalist">....</datalist> element on top of the form.
And then connected the datalist to the SharePoint field

Code: Select all

fd.field('Personal_x0020_titel').control()._el().find('input').attr('list', 'mydatalist')

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests