Home > General > Manipulating SharePoint Lookup Field values using Javascript

Manipulating SharePoint Lookup Field values using Javascript


This article gives an small trick for manipulating the values of SharePoint Lookup Field (OOB control for list item lookup). For one of my assignments I was required to manipulate the values listed into SharePoint Lookup Field so I did it in this fashion đŸ™‚

function getField(fieldType,fieldTitle)
{
var docTags = document.getElementsByTagName(fieldType);
for (var i=0; i < docTags.length; i++)
{
if (docTags[i].title == fieldTitle)
{
docTags[i].readOnly = true;
docTags[i].setAttribute(“choices”,”Comment 1|20″);
}
}
return false;
}
getField(‘input’,’Comment Type’);

Advertisements
Categories: General Tags:
  1. August 30, 2016 at 1:49 am

    Helpful info. Lucky me I found your web site by chance, and I’m shocked why this twist of fwte did
    not came about earlier! I bookmarked it.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: