SharePoint Form Simplification - Consolidate Your Form Views

Posted by Gary Levine on 07.08.15
Gary Levine
Find me on:

When creating a custom form in SharePoint Designer it is sometimes useful to change how some or all form fields display. This is especially true with complex SharePoint forms that have multiple tabs and intricate logic. Rather than doubling your efforts to create multiple forms in different modes this can be switched dynamically. The goal here is to eliminate the need to customize the dispform.aspx, newform.aspx and the editform.aspx when changing a list form. This process will help you customize a single form, and display it whether the user is in new, edit or view mode.

First start by creating a new Edit Form.

Change SharePoint Form Type - Create a new Edit Form

If you are working in SharePoint Designer 2013 make sure to select the DataFormWebPart tag then click on the Parameters button.

Change SharePoint Form Type -Select DataFormWebPart tag

Create a new parameter called FormType with a source of “Query String”. Name the Query String Variable something suitable (such as “formType”) and give it a default value of “Display”.

Change SharePoint Form Type - Create Query String Parameter

Next, update the server tag for the form field elements.

Find the “ControlMode” parameter for the fields you would like to change:

Change_SharePoint_Form_Type_-Find_Control_Mode_Parameter

Change the value from “Edit” to “{$FormType}”.

Change SharePoint Form Type - Change ControlMode Parameter to FormType

If you are changing all of the fields you can use the Find/Replace tool.

Change_SharePoint_Form_Type_-_Use_Find_Replace_tool

Save your form and press F12 to preview.

This image below shows the form in Edit mode. Note the Query String Parameter “formType”

Change SharePoint Form Type - Note Query String Parameter in Edit Mode

This image below shows the form in Display Mode. Note the Query String Parameter “formType” is now set to “Display”.

Change SharePoint Form Type - Note Query String Parameter in Display Mode

Since “Display” is the default value for FormType we can leave this parameter off of the URL and it will still work.

Topics: SharePoint 2013, Tutorial

Subscribe Here!

Recent Posts

Posts by Tag

See all