Customization of default SharePoint forms


If you wish to change the look and feel of default SharePoint list forms without using SharePoint Designer or infopath, go with the below steps:

  • Save the below code in a notepad and upload it in Site Assets
  • Go to the desired list and click on Add New Item
  • In New Form Page, click on Edit icon or click on Site Actions->Edit Page
  • Click on “Add a Web Part” hyperlink and select Media and Content->Content Editor->Add
  • Edit the web part and provide the url of the uploaded file in Content Link
  • Click Apply and stop editing the page
  • Repeat from step 3 for Display and Edit Forms

ADVANTAGE:

  • Code does not require modification whenever field is added to or removed from the form.

CODING:


<style>
/*Hide Quick Launch*/
#s4-leftpanel
{
display:none;
}
/*Move the content part to extreme left*/
.s4-ca
{
margin-left: 0px;
}
/*Rest of the below code are with respect to the form*/
.ms-formlabel
{
background:#C2D69A; /*Change the color code as per your wish*/
}
.ms-standardheader
{
color:black;
font-weight:bolder;
}
.ms-formbody
{
background:white;
}
BODY
{
color:black;
}
input[type=&quot;button&quot;]
{
background:#C2D69A;
color:black;
font-weight:bolder;
}
.ms-formtable
{
border-spacing:1px;
}
</style>

RESULT:

form