Category Archives: SharePoint 2013

Display information from another list based on a lookup column connection: Updated version

Change log
November 01. 2013
v1.45: Changed the DispForm code to fix an issue with picking up the ID of the selected item. Thanks to Dmitry.

October 29. 2013
v1.44: Fixed a bug where the FieldInternalName and not the DisplayName was used as formlabel.

October 26. 2013
v1.43: Fixed a bug (data is not pulled in) in EditForm. This bug is affecting all browsers, but for IE it kicks in only when the lookup columns contains less than 20 items.

October 17. 2013
v1.42: Changed how the id of the value fields pulled back from the lookup column is generated. This to ensure unique IDs when using this feature on multiple fields. Now the ID is constructed like this:

[FieldInternalName of the Lookup column]_[FieldInternalName of the field pulled in]

Look at the bottom of the article for details.

October 17. 2013
v1.41: Added compatibility with DFFS. To achieve this, I have appended the table to the formbody of the lookup column. This to ensure the information is hidden with the field itself when changing tabs or hiding fields by rules.

This is an update of a previously posted article.

This solution lets you pull in additional information from another list based on a lookup column. It works much in the same way as the SP2010 / 2013 lookup column setting “Add a column to show each of these additional fields” found in the list settings > Change column. The difference is that this one works in NewForm and EditForm as well, where the built-in SharePoint feature only works in DispForm.
This image shows NewForm
All the highlighted fields have been pulled in based on the lookup column. Please note that these fields are not stored in the current item, but are shown when viewing the form in NewForm, DispForm or EditForm.

I have updated the code to use spjs-utility.js and thus support newer versions of jQuery and browsers other than IE. The only new feature I have added, is support for displaying the information in DispForm.

I have NOT changed the function call to ensure backwards compatibility with the older solution.

This solution is in fact only tested in SP 2007, but should work for SP2010/2013 as well. Please post any findings below.

Use this code in a CEWP below NewForm, DispForm and EditForm:

<script type="text/javascript" src="/test/English/Lists/PullInfoFromLookup/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/test/English/Lists/PullInfoFromLookup/spjs-utility.js"></script>
<script type="text/javascript" src="/test/English/Lists/PullInfoFromLookup/PullInformationFromConnectedList.js"></script>
<script type="text/javascript">
var fields = init_fields_v2();

/* Object containing all arguments for the function
 * "arrFinAndDispName" is an array on format "FieldInternalName|Display name" from the list the lookup is pulling information from
 * "ListGuid" is the list Guid or the displayName of the list the lookup is pulling information from
 * "LookupFIN" is the FieldInternalName of the lookup column.
var argumentObj = {'arrFinAndDispName':['TextField1|My text field 1',
						   'TextField2|My text field 2',
						   'TextField3|My text field 3',
						   'RichText|Rich text multi line'],


Download the code
The code for the file “PullInformationFromConnectedList.js” can be found here, spjs-utility.js is found here, and jQuery here.

How to access the values after they have been pulled in to the table
Each of the TDs with the values have been assigned an ID like this:


The green part is the FieldInternalName of the lookup column, and the red part is the FieldInternalName of the field that the info is pulled from.

To get the value from this field, you use a standard jQuery selector like this

var myFieldVal = $("#MyLookupColumn_TextField1").html();

Ask if anything is unclear,

Convert text fields to cascading dropdowns – unlimited number of levels

You find updated documentation here

Change log
August 21, 2015
Changes in v3.524

  • Fixed a bug when using single quote in the items used in the dropdown menu.

July 13, 2015
Changes in v3.523

  • Fixed issue with :multi and hide empty dropdowns not hiding the correct elements.
  • Fixed issue with :multi and autofill single option not properly selecting the items.

May 06, 2015
Changes in v3.520

  • Fixed a bug that prevented the solution from working if you did not have spjs-utility.js loaded in the page where you used the cascading dropdowns.
  • Made some changes to the debug output. The debug is now show directly in the page so there is no need to open the developer console.

April 15, 2015
Changes in v3.510

January 19, 2015
Changes in v3.30

  • Added support for autofilling values when using “Autofill subsequent dropdowns when they contain only one valid option.” in DFFS.
  • Changed the jQuery variable from $ to spjs.$ to fix a bug with SharePoints internal file “assetpicker.js” as this one kills jQuery.

September 4. 2014
Changes in v3.27
Fixed an issue where DFFS triggers on subsequent dropdowns would not trigger when the “Autofill subsequent dropdowns when they contain only one valid option” is checked (and the options are autofilled).

September 3. 2014
Changes in v3.26
Added “lookupListBaseUrl” as option in the argument to the function. This is used to lookup from a list that is not located in the same site (but in the same site collection). If you are using DFFS v4 you must update to this version.

June 10. 2014
Changes in v3.25
Skips the loading of the script if it is loaded in DispForm. This will prevent some errors when using this solution with DFFS and you are cloning settings from NewForm or EditForm.

June 7. 2014
Changes in v3.24
Added autofill of subsequent dropdowns if the field has a default value.

March 1. 2014
Changes in v3.22
Added new switches: “autoselectSingleOption” and “clearInvalidSelection”. See description below.

February 20. 2014
Changes in v3.21
Added autoselect if only one option is found.

August 29. 2013
I had forgotten a console.log in v3.1, Please download it again.
August 28. 2013
Changes in v3.1
Fixed a bug that prevents getting more then 30 items for each dropdown.

This solution lets you convert multiple single line textfields to cascading dropdowns populated by a query into another list that holds the data.

I’m reusing these two images from a previous article in this series to demonstrate the source list configuration and the target list appearance after the solution is initiated:

From v3.510 you can use multiselect in all the dropdowns.


I have previously posted two solutions in this series:
Cascading dropdowns
Cascading dropdowns in SharePoint text fields – populated by lookup in another list (version 2)

This is the third revision done mainly for compatibility with the Dynamic Forms for SharePoint solution, but it can also be used as a standalone solution. The earlier solutions had a 5-level limit, but this one in unlimited.

Used with the Dynamic Forms for SharePoint solution

Refer this solution in the CEWP where you set up the DFFS solution like this:

<link type="text/css" href="/Scripts/DFFS/default.css" rel="stylesheet">
<script type="text/javascript" src="/Scripts/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/Scripts/spjs-utility/spjs-utility.js"></script>
<script type="text/javascript" src="/Scripts/CascadingDropdowns/SPJS-Casc_min.js"></script>
<script type="text/javascript" src="/Scripts/DFFS/dffs.js"></script>

You will now find the configuration for the solution as a separate tab in the DFFS GUI:

Please note that you will not find this tab when configuring DispForm, and that this will require version 3.1 or later of the DFFS solution.
Used as a standalone solution

To use this as a standalone solution, you must do the configuration in the CEWP code like this:

<script type="text/javascript" src="/Scripts/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/Scripts/CascadingDropdowns/CascadingDropdowns.js"></script>
<script type="text/javascript">
Please note that the CEWP must be placed below the list view web part.
Parameters explained

lookupList: List name or GUID of the list that holds the values to populate the dropdowns.
lookupListBaseUrl: Base URL of the site where the list is located. This is NOT the URL of the list itself.
lookupListFields: The FieldInternalNames of the fields in the above list.
thisListFields: The FieldInternalNames of the fields to convert to dropdowns.
dropDownDefaultvalue: The value to display in the dropdown select when no items has been selected.
hideEmptyDropdowns: Determines whether or not to hide dropdowns with no available options.
autoselectSingleOption: If the next dropdown contains only one option it will be automatically selected.
clearInvalidSelection: If you open a list item in EditForm and the original selection no longer is a valid selection, you can decide whether to clear it or keep it.
debug: Used to troubleshoot the setup. You must have the developer console activated to read the debug information. While this is “true”, the single line of text field will show below the dropdown select.

The length of the arrays “lookupListFields” and “thisListFields” must be the same.

Using multi select

Read this article to learn how to use the multi select option for the fields.

Download code

Get the code for the file “CascadingDropdowns.js” here.

Please support the development of this solution by hitting the “beer button” in the top right corner of this page to buy me a few beers.

Have fun,

vLookup for SharePoint 2013 v1.5

Change log
September 3, 2014
Changes in v1.730:
Minor update for compatibility with DFFS v4 “direct to backend script”.

June 27, 2014
Changes in v1.723:
Added check for a function named “vlookupChildViewOrEditCallback” to detect open or edit of a child (in dialog only). Add a function with this name, and it will be called when the dialog closes.

April 29, 2014
Changes in v1.721:

  • Fixed a bug from the previous version when using [URL:Key] in the CAML: NOT supplying the URL parameter generated an error.
  • Changed how the debug also alerts the values set in NewForm of the child item when using ?vLookupDebug=1 in the url

April 27, 2014
Changes in v1.720:

  • Fixed first column width if header row is hidden.
  • png icons in SP2013 and fallback to white icon for file types not recognized.
  • Added icons to show the view state of the groups (when using grouping).
  • Added option to use a URL querystring variable in the CAML. Hover over the help icon for the “Build Query” or the “Write your own CAML-query” to learn how to use it.

April 21, 2014
Changes in v1.710:
If you leave all display names in the viewFields section empty, the header row will be hidden.

April 13, 2014
Changes in v1.700:

Please note that there are a number of changes in this version and there will most likely be a few new bugs. You should test it before adding it to a production environment. Let me know if you find a bug, and I’ll fix it as soon as I can manage.
  • Fixed a compatibility issue with “fixQuirkyLookup” in the function “init_vLookupFields”.
  • Added option for selecting whether or not to open “new child” in a dialog.
  • Added “Show all option” when using “Rowlimit”.
  • Added support for grouping the items.
  • When using “Attachments” as viewField you will now get the paperclip in stead of “Yes” or “No” to indicate that an item has attachments.
Please note that you must index the columns you are querying to prevent errors when you reach a total of 5000 items in the list.

April 13. 2014
Changes in v1.651:
Fixed an issue with IE 11 for SP 2013: L_Menu_BaseUrl is undefined.

February 2. 2014
Changes in v1.65:

  • Changed <View Scope=’Recursive’> to <View Scope=’RecursiveAll’> to fix a bug with discussions (that are in fact folders).
  • Added option to refresh all vLookup columns when one has changed.
  • Added option to open links in the same window, and not in a new dialog.
  • Minified the code.

January 04. 2014
Changes in v1.644:

  • Added L_Menu_BaseUrl and L_Menu_LCID to the script for IE 11 compatibility in SP 2013.
  • Wrapped the table cell values in a div for better handling of “ViewField Special configurations CSS”.
  • The “ViewField Special configurations CSS” will also be applied to empty cells.
  • Fixed missing refresh in list view when a vLookup item is added or edited.

December 06. 2013
Changes in v1.640:

  • A new Action: “Comma separated list” is added. See instructions on the help icon for the “Action” field.
  • Custom style now works for all column types and not only text and note columns.
  • Date format can now be specified in the “In URL” section. See the help icon for details.
  • A few small bugfixes.

November 12. 2013
Changes in v1.631:
Child table max-height: changed overflow:scroll > overflow:auto to hide the scrollbar if it is not needed.

November 3. 2013
Changes in v1.63:

  • Added option to pass an URL parameter to the child list NewForm when adding children. Hover over the help icon for instructions.
  • Added option to set the max-height on the child table to have vertical scrollbars.
  • Changed how the page id is calculated when storing and retrieving the configuration. In some cases it came out wrong.

October 11. 2013
Changes in v1.62:
Added the number formatting support for “Action” sum, average and count.

October 11. 2013
Changes in v1.6:
Updated the number formatting support and added separate setting for “thousandsSeparator”. You can now use one or more of the following settings: “decimals”:2,”thousandsSeparator”:”.”,”decimalSeparator”:”,”}

October 06. 2013
Changes in v1.59:

  • Fixed set multichoice column from URL.
  • Added automatic refresh of the vLookup table when editing a child.

September 16. 2013
Changes in v1.56: Fixed a bug regarding showing documents located in sub folders in a document library.

September 10. 2013
Changes in v1.55:

  • Fixed a bug regarding multi choice people pickers.
  • Changed the available “events” you can use.

Interaction / events (put code in the CEWP)

// If defined, this function is called when clicking on "add new child". This function must return true to allow for children, or false to disallow.
function vlookupAddChildPreCheck(fin){
		// check something and return false if conditions are not met
	return true;

// If defined, this function is called for each of the fields set in the child from the "In URL" setting.
function vLookupPresetFromUrlDone(fin){
		// do something

// If defined, this function is called when a vLookup column is rendered complete.
function vLookupIsLoadedCallback(fin){
		// do something

// If defined, this function is called when a child is added and you close the dialog with "OK".
function vlookupChildAddedCallback(){
	// Do something

// If defined, this function is called when you click "add new child", but close the dialog without saving.
function vlookupChildNotAddedCallback(){
	// Do something

August 28. 2013
Changes in v1.53:

  • Fixed bug in multiselect viewfields (checkboxes, multilookup and multiuser)
  • Added rowlimit setting for the query.
  • Changed some ids and variable names in the code.

This solution lets you create relationships between two or more lists based on for example a lookup column connection. You can list all children in the parent element (the children has a lookup column targeting the parent). This is not possible out of the box in SharePoint.

You can also have any kind of dynamic query based on values in the current form. You can for example pull in information from a list based on a selection in a choice column. Please note that this last example will not pull in this information on the fly when changing the selection, but when the form is loaded in DispForm, EditForm or in a list view.

This solution also lets you create new children from the parent (both DispForm, EditForm and in list views), and lets you auto-populate the “connection” to the parent element to ensure a connection.

Image from the GUI
I have previously posted two articles in this series:
vLookup for SharePoint 2010
vLookup now supports SharePoint 2013

This one is done mainly for compatibility with the Dynamic Forms for SharePoint solution, but I have redone the code and also fixes a few bugs and adds some new features:

  • The creation of the configuration list is now triggered when you first enter the setup. This is done to prevent some rare bugs where the list is not detected onload, thus asking to create it despite it already exists.
  • The heading for number columns are now aligned right (as the values)
  • Fixed bug where exiting the setup did not load the form with its item-ID.
  • Added custom css for the viewFields. Hover over the help icon to the right of the “ViewFields” section for details.
  • Added option to enter a license code to remove the PayPal-logo in the top of the GUI
Used with the Dynamic Forms for SharePoint solution

Refer this solution in the CEWP where you set up the DFFS solution (DispForm and EditForm) like this:

<link type="text/css" href="/Scripts/DFFS/default.css" rel="stylesheet">
<script type="text/javascript" src="/Scripts/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/Scripts/spjs-utility/spjs-utility.js"></script>
<script type="text/javascript" src="/Scripts/vLookup/vLookup.js"></script>
<script type="text/javascript" src="/Scripts/DFFS/dffs.js"></script>
Used as a standalone solution in forms or list views

To use this as a standalone solution, you must do the configuration in the CEWP code like this:

<script type="text/javascript" src="/Scripts/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/Scripts/spjs-utility/spjs-utility.js"></script>
<script type="text/javascript" src="/Scripts/vLookup/vLookup.js"></script>
First setup

Please note that the setup must be MANUALLY triggered the first time. Set up the scripts, create the vLookup column and then – in DispForm – add this to the URL to create the list:
/Lists/mylist/DispForm.aspx?ID=[an existing ID in your list]&vLookupSetup=1

Refer the previous articles in this series for further details on the setup process.

Download code

Get the code for the file “vLookup.js” here.

How to remove the PayPal-logo / Unlicensed version from the GUI?

In this version I have added support for providing a license code for removing the PayPal-logo and displaying a “Registered to” text in stead. To obtain a license code, go to this page, scroll down to “Dynamic Forms for SharePoint / vLookup for SP201X” and follow the instructions.

As this is JavaScript, there is of course no problem to bypass this license code and manually remove the logo, but please remember that I put in a lot of hours developing these solutions, and I appreciate a few beers now and then.

Please post any bugs or comments below.

spjs-utility.js v1.17

Change log
January 29. 2014
Added option to clear a people picker in SP 2013 using setFieldValue – specifying an empty string as new value.

November 24. 2013
Added option to pass scope to the function “spjs_QueryItems”. Use “scope”:”Recursive” to search all items without folders.

October 30. 2013
Fixed bug in init_fields_v2() regarding converting HTML formatted text in a calculated column to proper HTML.
getUserInfo_v2: customProp

October 23. 2013
Radio: setFieldValue will clear choices first. This mean you can set a radio choice field to “null” by passing an invalid value – like a blank string.
Calculated html converted in init_fields_v2()

September 13. 2013
In v1.173:

  • Added option to set a single choice Lookup column rendered as a <select> by ID.
  • This affects lookup columns with <20 items in IE, and all lookup columns in other browsers.
  • Changed the method of setting lookup colums to ensure they first try to match by TEXT and them by ID.

August 21. 2013
I had a mixup in the files and uploaded v1.17 in stead of v1.171. You will have to download v1.171 again. Sorry for the inconvenience.

August 20. 2013
In v1.171 i have fixed a typo preventing you from getting the loginName when using it to get the value from a people picker field in SP2013. I have also changed how getFieldValue handles people pickers in SP2013 by using the built in methods to get the field value.

When using getFieldValue to get a people picker value on page load, you must wrap the call like this:

	var myPeoplePickerValue = getFieldValue("MyPeoplePickersFieldInternalName","","; ","loginName");

I have updated spjs-utility.js to v1.17 with these changes:

  • Fixed compatibility issue in SP2013 with RTE fields and people picker fields.
  • Added support for getting and setting “Managed metadata fields” or “SPFieldTaxonomyFieldType” and “SPFieldTaxonomyFieldTypeMulti”.

This file is used in multiple solutions – like this one.


Dynamic Forms for SharePoint v3

Change log
Always test a new version to see that it works as expected before adding it to a production environment.

June 19. 2014
v3.352 has these changes:
Fixed the following that went missing in v3.350:

  • Added back the content type choice as trigger and selectable field.
  • Added back the file name field as trigger and selectable field.
  • Added back the additional lookup column fields to the DispForm configuration.

June 10. 2014
v3.351 has these changes:

  • fixQuirkyLookup: Added title attribute to the select for compatibility with SPServices
  • Added back the Attachment field as this had disappeared from the field select in the tabs in v3.350.

June 7. 2014
v3.350 has these changes:

  • The method for reading the fields for the list in the configuration GUI has changed. I now query the list schema for the fields rather than finding them from the current form. This means that you can now configure DFFS for a form with content types without having to add all fields to the default content type. Please note that only the fields in the active content type will be available to the script when NewForm, DispForm or EditForm is rendered.
  • Lookup columns containing more than 20 items in SP 2007 / 2010 using Internet Explorer (quirky lookup columns) can now be used as triggeres. If you are NOT using SPServices cascading dropdown you must tick “Fix quirky lookup columns” in the Misc tab.
  • Triggers are now organized in more “optgroups” to clarify how they trigger (on load, on save etc.)
  • The “doSetFieldValue” function have been changed to support setting Cascading dropdown value using the “Set field value” action in the rules. Please update the cascading dropdown plugin to v3.24 or above.
  • You can now manually specify the location of the DFFS configuration list. This may come in handy when using DFFS in a list template. See separate heading in the bottom of this article.

May 8. 2014
v3.343 has these changes:

  • Changed how the plugin tabs are shown if the plugin is not loaded: the tab will contain a link to download it.
  • Changed how the configuration is done for the resource management plugin.
    Setup is now done in a separate tab and you must remove any configuration from the Custom JS section in the Misc tab.

May 1. 2014
v3.342 has these changes:

  • Changed how the SPFieldMultiChoice events are triggered. It was initially on “click” and now it is on “change”.
  • Added “is changed” trigger on SPFieldChoice, SPFieldMultiChoice and SPFieldBoolean.
  • Changed a little bit on the “is changed” comparison to catch change BACK TO what was the initial value when the form was loaded.

April 25. 2014
v3.341 has these changes:

  • Navtabs now operates in a circular motion: When passing the last tab, it will start from the first tab again.
  • Added check to see if the attachment field in not part of any tab. If so, the attachments will show in all tab.
  • Added option to disable individual rules by a checkbox in the top right corner of each rule.

Only “dffs_min.js” is updated.

April 20. 2014
v3.340 has these changes:

  • Fixed setQuirkyLookup so that getFieldValue will pick up the correct selection if you use it in PreSaveAction.
  • Added support for the new version of SPJS Resource Management:
  • Moved password to Misc tab.
  • Displayed the plugin version used for the various plugins like vLookup, Cascading Dropdowns etc.

April 7. 2014
v3.336 has these changes:
Changed the offset of the custom edit item image in the ribbon for SP2013 as Microsoft uses different image maps in 365 and on premises install of SharePoint – resulting in the wrong image being displayed.

April 3. 2014
v3.335 has these changes:
Fixed bug related to “orphans tab” not working after update in v3.333. Please note that the id of the tab <lt> has changed from “tab_orphans” to “dffs_tab_999”. This affects any custom code you may have used to style or attach events to this tab.

March 22. 2014
v3.334 has these changes:
Changed an alert for when you are trying to hide the active tag by a rule.

March 21. 2014
v3.333 has these changes:

  • Fixed compatibility with SP 2007 and IE8 running on Windows XP.
  • Changed / fixed tab selection by url (?sTab=X), by cookie or when one or more tabs are hidden by rules.
  • Fixed a bug in showing field description with readonly fields when the field description has a trailing <br>.
  • Fixed a bug with using “selected tab index” as trigger in rules (the selected tab index was not always updated on click.

March 17. 2014
v3.330 has these changes:
Fixed a bug from v3.329 where the form was hidden if you had not configured tabs.

March 16. 2014
v3.329 has these changes:
Fixed initial tab selection if the primary tab is hidden by a rule. In this scenario you would have no selected tab, but the form would still be visible. The code will now try to select the next visible tab. If no tabs can be selected, the form i hidden.

March 15. 2014
v3.328 has these changes:

  • Fixed “Selected tab index” in Misc tab. This was disabled by the cookie introduced in v3.320. The selection will still be remembered by the cookie, but on the first visit to this tab in this browser session it will preselect the tab from the Misc tab.
  • Added option in the Misc tab to control the use of cookie for remembering the selected tab.
  • Disabled the “selected tab” cookie for NewForm.

v3.326 has these changes:
Changed dffs_PreSaveAction() to be able to return false to abort the save process. Returning true or nothing will proceed with the save.

v3.325 has these changes:

  • If there is a function “dffs_Ready()” in the CEWP or in the Custom JS, this will be called when the DFFS solution has finished loading.
  • Added “is changed from initial value” trigger to choice columns as this was missing.
  • Added MUI support to the tab navigation buttons.

March 5. 2014
v3.323 has these changes:
Fixed a random error message: [DFFS: spjs.dffs.loadAndApplyRules]: Configuration error.

March 4. 2014
v3.322 has these changes:
Added back the missing “extra” edit item button to the left of the “Cancel” button. This had disappeared in v3.20.

v3.321 has these changes:
Removed a trailing comma in an object (introduced in v 3.32) that broke the script in IE8.

March 1. 2014
v3.32 has these changes:

  • Error in description for the trigger “If logged in user is in group with ID”.
  • Duplicated edit button in some situations.


  • Added alert to catch use of “And these rule indexes are true” looking at a rule that has a higher index than the current rule.
  • Added option to turn on/off the “Fix quirky lookups” feature introduced in v3.3. You find the option in the Misc tab.

New features

  • Added a cookie to remember selected tab trough page refresh.
  • Added new trigger “is changed” for text / number fields. This triggers on any change in the field. The existing trigger with the same name has been renamed to “is changed from initial value” (existing configurations will be automatically updated).
  • New config options for cascading dropdowns: Autofill and Clear invalid. Please note that you must update the cascading dropdown solution separately for the new features to be supported.
  • Added options to show navigation buttons to switch tabs. You find the setting in the Misc tab.

February 17. 2014
v3.315 has these changes:

  • Added “Run these functions” feature to DispForm.

February 13. 2014
v3.314 has these changes:
Attempted to fix an issue with having multiple triggers on “Selected tab index”, where only the last rule applied.

January 29. 2014
v3.313 has these changes:
Fixed a bug in “setQuirkyLookup” for SP2007 as the id of the hidden input field contained characters that needed to be escaped.

January 25. 2014
v3.312 has these changes:

  • Small fix for dialog size when adding attachments.
  • Triggering on date fields now properly supports “Equal to” = [empty string].
  • Fixed bug that halted the script when using ID as trigger in EditForm.
  • Fix for timing issue in SP 2013 that resulted in triggers not picking up the correct value.
  • Added a handful of missing semicolons and minified the code using packer by Dean Edwards.

You can now use the minified version of dffs.js. Pick it up in the download section.

January 21. 2014
v3.311 has these changes:

  • Removed check for fields that were set as required in the list settings as this produced an error in “spjs.dffs.clear_Mandatory”.
  • Fix for SP 2007 compatibility for the “Fixes the quirky dropdown select” added in v3.30.
  • Attempted to fix the randomly missing scrollbar issue in dialog boxes.

January 4. 2014
v3.31 has these changes:

  • Added option to fix the dialog to the top of the screen to prevent it from jumping around when you change tabs. This applies to SP 2010 / 2013 and can be found in the Misc tab.
  • Addressed an issue with spjs.dffs.clear_Mandatory and fields set as requires in the list settings.

December 21. 2013
v3.3 has these changes:

  • Added operator “is changed”. This is used to trigger a rule if the field value has changed after the form was loaded.
  • Added trigger “Compare logged in user with people picker field”. This can be used to trigger a rule if the logged in user is or is not selected in a given people picker field.
  • Fixed tooltip left adjustment to prevent the text form rendering outside the screen when using side-by-side.
  • Added z-index:1001 to the tooltip container to fix a rendering issue in SP2013 where some elements shined trough the container.
  • Tried to fix an issue with setting a people picker to readonly in SP2013 and getting a “field is not ready” error. I could not reproduce this error and therefore cannot promise this will fix it.
  • Fixes the quirky dropdown select in Internet Exploree used for a single lookup column when there are more than 20 items in the lookup source list (SP2007 and SP2010).

You must update both the “DynamicFormsForSharePoint_v3.js” and the “default.css”.

Please note
I no longer have access to a SP 2007 environment and therefore I cannot guarantee compatibility with SP 2007. If you use this solution with SP 2007 you must add this variable to the page for compatibility with v3.3+:

var _spPageContextInfo = {"pageListId":"{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"};

You must change the string “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx” with the list GUID of the current list. You should be able to find it by viewing the page source and searching for “ctx.Listname” (SP 2007).

November 28. 2013
v3.262 has these changes:
Fixed bug with attachments due to a function changing the id “idAttachmentsRow”.

v3.261 has these changes:
Fixed a bug in v3.26 regarding L_Menu_BaseUrl.

November 24. 2013
v3.26 has these changes:
Added a check for a function named “dffs_PreSaveAction” when saving the form. Use this function to add “pre save code” like this (the function must NOT return anything):
function dffs_PreSaveAction(){
// do stuff before saving
November 21. 2013
v3.25 has these changes:
Yet another fix for detecting folder content types and summary tasks in a tasks list.

November 17. 2013
v3.23 has these changes:

  • Better detection of “New folder” to prevent the DFFS code from triggering.
  • Tooltip now supports vLookup columns that use “Hide form label”.
  • Set field value now updates the value in readonly fields.

November 3. 2013
v3.222 has these changes:

  • Removed the paperclip in front of the “Attachments” formlabel as adding attachments is not possible in DispForm.
  • Fixed undefined variable “isNewForm” > “”.
  • Added description to the tooltip section: If you use HTML code, do not add line feeds using Enter, add HTML code as a continuous string.
  • Hide save item btn now works both ways: No = show button.
  • Added option to hide edit item btn in DispForm. This works like the “Hide save item button”.

October 31. 2013
v3.221 has these changes:

  • Fixed unnecessary escaping og double quotes in object formatted strings (bug introduced in 3.22).
  • Fixed missing tabs in SP2013 Document library.
  • Fixed bug where sometimes the config is not recognized due to wrong case in the URL.

October 28. 2013
v3.22 has these changes:
Replaced a custom stringify method with the standard JSON.stringify. This because the custom method failed in some rare cases. This change will affect SP2007 when using IE. Because the master page forces Document Mode: Quirks, you must use another browser, or force the Document mode to IE8 using the developer console.

October 27. 2013
v3.21 has these changes:

  • Edit item button will not show in DispForm if the user does not have edit access.
  • Set Field Value now supports all available properties from the user list in SharePoint (not the user profile service). Use it like this: {currentUser:Prop}.

October 21. 2013
v3.20 has these changes:

  • Side-by-side: Label position can now be set to “Hidden”, “Top” or “Left”.
  • You can add attachments by clicking the paperclip in front of the Attachments label.
  • Added id attribute to the table row in this format: dffs_[FieldInternalName]. You can use this to address individual fields using custom code.
  • Comparing field values against other fields in the form is now supported for number columns (and text columns containing numbers)
  • Fixed an issue with “Set field value” using a value pulled from another field when the first character is not “{“.
  • “Set field value”: {timestamp} – see details below.
  • “Set field value”: {currentUser} and {currentUserEmail} – see details below.
  • “Set field value”: Prepend or append to existing text – see details below.
  • Creating a new folder now bypasses the DFFS solution.
New features in the “Set field value” section

Use {timestamp} to add a timestamp to a field.

Current user
Use {currentUser} or {currentUserEmail} to add the user name or the email (malito link) in a field.

Prepend or append to existing text in a multi line text field:
Prefix the string with “prepend:” or “append:”. Here is an example:

prepend:{timestamp} - {currentUser}: {Log}\n************\n

September 18. 2013
I have updated to v3.15 with these changes:

  • Initially hidden field can not be made visible by including them in a tab – you must use a rule.
  • Fixed set field value for multiline textfield

September 13. 2013
I have updated to v3.14 with these changes:

  • Fixed bug in clearing / reversing rules for unselected choice columns. This bug would incorrectly trigger the rule when clicking another option in the choice columns.

September 12. 2013
I have updated to v3.13 with these changes:

  • Fixed typo “dropdodwns”
  • Changed the CSS file to make the form look the same in DispForm and EditForm when using side-by-side.
  • Added trigger for “Selected tab index.
CSS when using side-by-side

Insert this CSS in the Custom CSS section in the Misc tab if you want to:

stretch the outer table for all rows of side-by-side fields


stretch the outer table for a specific row of side-by-side fields

#sbs_OuterTR_1 .sbs_OuterTable{

sbs_OuterTR_1 the highlighted number represents the side-by-side index used in the setup.

control each field when using side-by-side

Trigger “Selected tab index”

This trigger is used for triggering rules when clicking on a tab. Please note that the rule will be reversed when it does NOT match.


Lets say you want a field to trigger a rule for one tab only. To achieve this, first create a rule using “Selected tab index”, but leave all “actions” empty (no required fields etc.).

Now create the rule for the trigger field and insert the rule index of the “Selected tab index rule” in the “And these rule indexes are true”.

You now have a rule that triggers on a field, but only applies for this specific tab.

August 19. 2013
I have updated this solution to v3.1 withe these changes:
New features:

  • Added support for Cascading dropdowns – see separate article for detail.
  • Added option to enter a license code to remove the PayPal-logo in the top of the GUI.


  • Removed “Set field value” from the DispForm configuration.
  • Fixed a bug preventing “Set field value” using [Today].
  • Fixed a bug when triggering a function in a rule on load.

You must update both the *.js, the *.css file and spjs-utility.js.

August 13. 2013
Second attempt with v3.02: fixes a bug preventing the user from saving the first time the configuration is added.

How to remove the text “Unlicensed version” from the GUI?

To obtain a license code, please go to this page: Obtain License Code, select the license type and pay using PayPal. I will send you a license code as soon as i receive the receipt from PayPal.


This is a solution for creating dynamic forms from out of the box SharePoint forms (preferably without content types). You can create rules that control whether fields are required or optional, visible or hidden, editable or read-only. You can also create tabs that you can target specific SharePoint users or groups, and you can add headings and rich tooltips for fields in the form.

You can link directly to a specific tab using this URL format:
…/DispForm.aspx?ID=[an existing id from your list]&sTab=2
…/EditForm.aspx?ID=[an existing id from your list]&sTab=2

The GUI:

Previously articles in this series
New in v3

I have done a major overhaul of the code, fixed some bugs and added new features:

  • Radio buttons can now be arranged vertical.
  • When arranging multichoice or radio buttons vertical, the “fill in” will line up correctly.
  • Fixed width of select when using “Arrange multi lookup columns vertical” in SP 2007.
  • Custom CSS and JS: Small fix to try to avoid occasional errors.
  • Export and import of settings are now in place.
  • A copy of the last good configuration is automatically kept, and can be restored by a click of a button if you “break” it.
  • Backwards compatibility is now better. Please note that downgrading to an older version will require you to restore a backup of the original setup.
  • Changed the rule builder and added more fine grain controls of:
    • Optional fields and required fields
    • Visible fields and hidden fields
    • Editable fields and read-only fields
    • Visible tabs and hidden tabs
    • Visible headings and hidden headings
  • “Display this message” and “Alert this message” is now present in DispForm.
  • You can now control who sees the enter setup button.
  • You can now control who sees the orphan fields tab.
  • You can now distribute tabs over multiple lines and not only 2 as before.
Manually specify the location of the DFFS configuration list

Why do it:
If you want to use DFFS in a site template and share the configuration between all the sites created from that template.

The configuation is stored using the list name from the URL in lower case letters as “unique identifier” like this:
This means you cannot configure DFFS for a list with the same URL name in a different site without them sharing this configuration.

How is it done:
Add this variable to the CEWP or HTML Form Web Part code (above the script tag that loads the DFFS script):

var dffs_configListBaseUrl = "/RelativeUrlToTheSite";

You don’t have to put the shared configuration in the root site, you can add a new, empty subsite to hold the configuration list, but you must ensure all users have read access to this site.

Repetition of how to set up this solution

Step one
Download the latest version of the DFFS solution files from here. This includes the *.js file, *.css file and the This last one should be unzipped before uploading to the file location (see below).

Step two
Download the latest version of spjs-utility.js from here.

Step three
Download v1.10.x or BELOW of jQuery here. Please note that version 2.x of jQuery does NOT support Internet Explorer 8 or below.

Step four
Put all these files in a standard document library or a folder created using SharePoint designer. Ensure all users have read access to the file location. Do NOT refer these files from as this server is not rigged to serve these files “live”.

Step five
Download the files “CEWP_example.txt” and “CEWP_Overlay_Example.txt” from here. Edit the script links (src) in “CEWP_example.txt” to point to the files stored locally. I repeat that you should NOT refer these files from

Add the code to NewForm, DispForm and EditForm of the lists where you want this solution activated. The “CEWP_Overlay_Example.txt” must be placed ABOVE the form web part, and the “CEWP_example.txt” code must be placed BELOW the form web part.

How to add a webpart to the form page
SharePoint 2007
Go to NewForm, DispForm and EditForm and insert toolpaneview=2 behind the URL in this format:
…/DispForm.aspx?ID=[an existing id from your list]&toolpaneview=2
…/EditForm.aspx?ID=[an existing id from your list]&toolpaneview=2

Press Enter and you should be able to add a CEWP to the page. Repeat for all three forms.

SharePoint 2010 / 2013
In the list view, click “List” on the List Tools menu. Then select “Form Web Parts” and pick NewForm, DispForm or Editform from there and add a CEWP to the page. Repeat for all three forms.

I recommend using the Content link option in the CEWP to refer the code. The CEWP code should be put in a text file (txt) or an aspx file and put in the same location as the other files.

If you plan to put the code directly into the CEWP, you should choose the HTML Form Web Part in stead.

Step six
Go to the list and click “Add new item”. Click the little dot in the bottom left corner of the form to enter setup. When entering setup for the first time, the script will create a list to store the configuration. For help in the GUI, hover over the question marks.

Upgrading from a previous version?

You will have to upgrade both the *.js, the *.css file and spjs-utility.js.

As this is a major overhaul of the code, you might have to do some reconfiguring of the rules. In general, all settings are kept, but you now have more fine-grain control of the various settings so some rules might have to be changed.

Make a backup
When entering the setup after loading the new version, go to the “Misc” tab and export the settings by copying the text to a file. This is your backup in case something goes wrong and you have to downgrade to an earlier version. If you must do this, use the backup file and restore it by pasting the text in the text area under “Import settings”. When you have done this, you can load the older version of the script.

Please support the development of this solution by hitting the “beer button” in the top right corner of this page to buy me a few beers.

Use the comment section below let me know if you find find a bug, or you have a question.


Dynamic Forms for SharePoint: Now with field tooltip

Change log
June 03. 2013
Changes in v2.981

  • Added Danish date format (LCID 1030).
  • Added option to arrange multilookup columns vertically.
  • Changed the identifier for the headings to prevent them from getting a new ID when they are moved or another heading is deleted.
  • Fixed a bug setting a multichoice column as mandatory using the fill-in option.

Multichoice columns vertical:

May 20. 2013
Changes in v2.98

  • Added support for arranging checkboxes (choice columns – allow multiple selections) in multiple columns. You find it under the Misc tab.

This update requires you to update the *.js and the *.css.

May 16. 2013
Changes in v2.971

  • Fixed required field check for multichoice columns.

This update requires you to update the *.js.

May 13. 2013
Changes in v2.97

  • Fixed missing trigger for Currency field.
  • Added option to initially hide a list of fields. This option is found under the Misc tab.

This update requires you to update the *.js.

May 13. 2013
Changes in v2.961

  • Fixed a bug in bringing fields visible when NOT using Tabs.
  • Cosmetics: Hidden the “Edit button” behind an image. Update the CSS file to have it initially hidden.

This update requires you to update both the *.js file and the *.css file.

May 10. 2013
Changes in v2.96

  • Disabled the solution when the page is in edit mode to prevent errors.
  • Fixed a glitch in “reversing” rules when using multichoice checkboxes.
  • Attempted to fix a chrome issue with disappearing scrollbars.
  • Added an option to include an overlay with “Loading, please wait…” to prevent flashing the unformatted form when loading – see details below.

In this release only the *.js file has changed, but if you want to use the overlay, follow the instructions below.


If you have some errors in your setup, or you do not have the latest version of the DFFS solution (2.96+), you will see this message after 5 seconds:

To use the overlay, place a HTML Form Web part ABOVE the form, and insert this code:

<style type="text/css">
<div id='dffs_loadingOverlay' class='dffsOverlay'>Loading, please wait...</div>
<script type="text/javascript">
		var oDiv = document.getElementById("dffs_loadingOverlay");
		if(oDiv !== null){
			oDiv.innerHTML = "<span style='font-size:20px'>This took forever!<span style='font-size:12px'><br><br>Ensure Dynamic Forms for SharePoint v2.96+ is referred correctly.<br><br>Click to close this overlay.</span></span>";
			oDiv.onclick = function(){
The article

I have updated the Dynamic Forms for SharePoint solution and incorporated the Form Field Tooltip for SharePoint 2007 and SharePoint 2010 solution.

The DFFS solution still supports SharePoint 2007, 2010 and 2013.

New in this release
Added tooltip:

Keep focus on tab through DispForm to EditForm
I have rigged it so that you will keep focus on the same tab when you edit a list item from DispForm.

How to update
You must update both the *.js and the *.css file. Get the latest version of the files from here

If this is the first time you implement this solution, please start with the first article linked above for setup instructions.

Update spjs-utility.js
You should update spjs-utility.js to v1.15 as I have fixed a bug in “getFieldValue” when using “Allow ‘Fill-in’ choices”.

Please comment below if you find a bug – or you like this solution.


SharePoint form: present fields side-by-side: Updated version

I have previously posted a solution for presenting form fields side-by-side.

This is an updated version derived from the DFFS project.

I have made this updated version by request from Steve Eberl because the older version proved incompatible with IE10. Hopefully this new version will be more compatible, but honestly: I have not tested it in IE10, as I have not installed it yet!

I have done some quick tests in SharePoint 2007 and SharePoint 2010. I guess it will work for SharePoint 2013 also, but this has not been confirmed. Please let me know if someone has tested it.

<script type="text/javascript" src="/test/English/Javascript/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="/test/English/Lists/SideBySide/spjs-utility.js"></script>
<script type="text/javascript">

spjs_sideBySide = {
		var h, b;
			var cssArr = [];
			cssArr.push("<style type='text/css'>");
			$("body").append(cssArr.join("")); = true;
				$(fObj[o.fin]).before("<tr class='sbs_OuterTR' id='sbs_OuterTR_"+o.index+"'><td valign='top' colspan='2'><table class='sbs_OuterTable' style='width:100%' cellpadding='0' cellspacing='0'><tr class='sbs_InnerTR' id='sbs_InnerTR_"+o.index+"'></tr></table></td></tr>");
			h = $(fObj[o.fin]).css("display") === "none";
			b = [];
			b.push("<td FieldDispName='"+$(fObj[o.fin]).attr('FieldDispName')+"' FieldType='"+$(fObj[o.fin]).attr('FieldType')+"' class='sbs_Field' fin='"+o.fin+"' id='sbs_Field_"+o.fin+"' valign='top' style='white-space:nowrap;");			
			b.push("<table class='sbs_FieldTable' style='width:100%' id='sbs_FieldTable_"+o.fin+"' cellpadding='0' cellspacing='0'></table>");
					$("#sbs_FieldTable_"+o.fin).append("<tr class='sbs_FieldLabel' id='sbs_FieldLabel_"+o.fin+"'><td class='ms-formlabel'> </td></tr>");
				$("#sbs_FieldTable_"+o.fin).append("<tr class='sbs_FieldLabel' id='sbs_FieldLabel_"+o.fin+"'></tr>");
			fObj[o.fin] = $("#sbs_Field_"+o.fin)[0];
		if(_spPageContextInfo.webUIVersion === 15){
			}, "sp.js");
			var dlg = SP.UI.ModalDialog.get_childDialog();
			if(dlg != null) {				
				if(!dlg.$S_0 && dlg.get_$Z_0()){
					var xPos, yPos, win = SP.UI.Dialog.get_$1(), xScroll = SP.UI.Dialog.$24(win), yScroll = SP.UI.Dialog.$26(win);
					xPos = ((SP.UI.Dialog.$1d(win) - dlg.$2_0.offsetWidth) / 2) + xScroll; 
					if (xPos < xScroll + 10) {
						xPos = xScroll + 10;
					yPos = ((SP.UI.Dialog.$1c(win) - dlg.$2_0.offsetHeight) / 2) + yScroll;
					if (yPos < yScroll + 10) {
						yPos = yScroll + 10;
					dlg.$T_0 = xPos;
					dlg.$U_0 = yPos;
					dlg.$m_0(dlg.$T_0, dlg.$U_0);
					dlg.$ = Math.max(dlg.$6_0.offsetWidth - 64, 0) + 'px';

var fields = init_fields_v2();
	index: Use the same index for all fields in the same row.
	fin: FieldInternalName of the field.
	labelHidden: Hide form label.
	padHiddenLabel: If labelHidden = true, set this to true to fill the empty space left from the hidden formlabel.

var arr = [

// For SP 2010

Please let me know whether it is functioning as expected.


Dynamic Forms for SharePoint: Now with side-by-side

Change log
May 06. 2013
I have released v2.95 – you find it here
April 28. 2013
Bugfixes in v2.94:

  • Fixed a bug regarding comparing date and time columns where the trigger column is empty.

April 14. 2013
Bugfixes in v2.93:

  • Fixed bug in validating required rich text field when using non English letters.
  • Fixed bug where fields appearing in the “orphan fields tab” when using Side by Side.
  • Prevented the ID column from appearing in the “orphan fields tab”.
  • Fixed bug where people pickers lost their value in EditForm in Chrome (and possibly other non-IE browsers).

There are changes in both “DynamicFormsForSharePoint_v2.js” and “default.css” – ensure you update both.

March 29. 2013
Bugfixes in v2.91:

  • Fixed bug in side-by-side functionality regarding the “fields” not getting the correct fieldtype and fielddispname attributes.
  • Fixed bug where the field label was repeated multiple times when combining side-by-side with readonly, and then switching tab.

I have released version 2.90 of Dynamic Forms for SharePoint with these changes:

  • Added content type choice as possible trigger field.
  • Added side-by-sice capabilities.
  • Fixed a bug where the link to add tabs were missing for the first setup.
  • Changed the function that dynamically resizes the dialog. This new function is created by Sing Chan, and can be found here
  • Added a fix for some occurrences where the variable L_Menu_LCID was missing in a SP2013 setup.
  • Fixed a bug in SP.UI.RTE.js that occurs when hiding rich text columns in SP2010. The workaround is provided by John Chapman.

Refer these articles for background information and setup instructions:
Dynamic Forms for SharePoint: Production
Dynamic Forms for SharePoint – Now with Tabs
Dynamic Forms for SharePoint: Now with support for SharePoint 2013

How to use the Content type as trigger

In NewForm and DispForm the content type is not visible other than in the URL. You must use the trigger “URL Query string parameter”, and “This value” like this:


Please note that the default content type id not always shows up in the URL. If you click the “New Item” in the ribbon (in SP2010), it is included, but if you click the “Add new item” below the list view, it is not. You should therefore add rules for the “not default content type”.

How to find the ContentTypeId
Go to list settings, click the content type you want the id from, and then look at the URL. You will find it like this:


In EditForm, you can select the content type select ine the trigger fields and address it by its display name.

Details on the side-by-side functionality

I have added an option to place fields side-by-side in the tabs like this:

The configuration is setup like this:

The yellow input fields is used to specify a common index number for the fields that are to be presented side-by-side. The fields will be lined up with the topmost field in the selection.

The checkbox is used to hide the form label for the fields like this:

Please consider the side-by-side functionality BETA, and report any bugs back to me by adding a comment below.