How to edit the form fields of a SharePoint List
September 5, 2007
Here’s an often forgotten feature that any SharePoint Designer person should be aware of. It’s the ability to edit and customize the default form fields for any list. This is made possible by using SharePoint Designer to navigate and open the form page that you want to edit. When you open the page you’ll see something like this:

You’ve probably tried right clicking around, trying to convert the web part to a dataview web part, and then you threw up your hands and said this is impossible!
But wait! Check this out… First select the ListFormWebPart and *EDIT: DO NOT hit the delete key. Instead hide the webpart. If you delete it, this will happen: http://support.microsoft.com/kb/935504



Ta da! Now you can go about your daily business of form customizations.



September 5, 2007 at 11:25 pm
Hi there
When i remove the title filed i get Error When i creat a new item?
And if any one know about removing the tiltle filed from list
thanks
September 6, 2007 at 7:24 am
I’ve noticed similar errors also but haven’t had a chance to figure out why. instead, i’ve used custom css to hide the fields i didn’t want instead of deleting it.
September 6, 2007 at 11:39 am
You”ll probably want to modify the content type for the list and use ShowInDisplayForm (or ShowInEditForm) to toggle the display.
September 6, 2007 at 12:46 pm
Thanks for the tip Oskar, but I’m a bit confused. Where would we be able to find the ShowInDisplayForm property?
September 17, 2007 at 11:04 pm
i can’t click SharePoint controls..how?thnx
September 18, 2007 at 7:52 am
You mean SharePoint Controls from the menu? Have you tried clicking onto a web part zone on the page before that?
September 18, 2007 at 4:27 pm
sorry..can u explain to me step by step..i want to edit my list..thnx!
October 18, 2007 at 2:31 am
hey anne,
make the List Form Web Part invisible. (if you still get the error, you have to recreate the list first)
put your custom list form inside.
after that, simply open the web part options and activate the “Hidden” option. thats all
October 30, 2007 at 3:36 pm
Hello.
I have a question regarding hidden fields. Is it possible to have fields (on a SharePoint list form) that are hidden or shown based on the selection made in another drop-down field? Or maybe a hidden sub-form?
I’ve been looking for a week for an answer to this all over the web, and I can’t seem to find it. Thanks!
May 20, 2009 at 7:12 am
Did you got the answer for this?
If so please share
October 30, 2007 at 10:24 pm
i’m thinking some custom javascript on one of the form pages should do the trick.
October 31, 2007 at 7:35 am
Henry, thanks for the quick answer. Have you seen anything like that out there? If I see it, I may be able to duplicate it. Any thoughts? Thanks again.
January 18, 2008 at 2:45 pm
Hello,
I am trying what you are saying, however I am still unable to use the Attachment button. I am getting a javascript error stating the the control is not available because it is hidden.
If this is the case then why not create a new form and import the custom list for into that? It does the same thing and you dont even have to touch the newform.aspx form.
Thanks for any help
June 18, 2009 at 9:35 am
Hi,
I am having the same issue with the attach button. Does anyone know how to restore the attach functionality in a modified custom form?
June 18, 2009 at 3:48 pm
Hey Sandy, I vaguely remember seeing this fix introduced with SP2.
March 26, 2008 at 6:15 am
in the above thing i need to make some feilds as read only is ther any posibility in doing this
September 8, 2009 at 12:00 am
Uday,we can make the form field read only using javascript on the page load…
_spBodyOnLoadFunctionNames.push(“makeReadOnly()”);
function makeReadOnly()
{
document.getElementById(‘ctl00_PlaceHolderMain_g_99d476b6_6f5b_487c_9498_d9029f585497_ff11_1_ctl00_ctl00_TextField’).disabled = true;
//document.getElementById(‘ctl00_PlaceHolderMain_g_99d476b6_6f5b_487c_9498_d9029f585497_ff11_1_ctl00_ctl00_TextField’).readOnly=”readonly”;
}
.
.
.
Check it out
April 23, 2008 at 12:04 pm
uday, after you have created your custom form, individually format the “read only” form field as “text” or “rich text” instead of as a list form item.
May 8, 2008 at 12:29 am
Hi,
is very useful. But one of my design problems thereby becomes not solved. On a wiki-site the option New Item Form is disabled. And just this I need. Is there an other possibility to do this? Thanks.
May 12, 2008 at 7:46 pm
Hey Tobia, I’ve also looked into doing this but haven’t found an easy option to edit wiki new form pages.
May 15, 2008 at 7:06 am
Hi –
Thanks – I followed the instructions and customized my NewForm. But when I try to load it, I get an error. Any ideas?
” Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor such as Microsoft Office SharePoint Designer. If the problem persists, contact your Web server administrator. “
May 28, 2008 at 3:20 pm
how do you ‘HIDE” the webpart in sharepoint designer?
June 2, 2008 at 6:56 pm
Hey dhx, you can right click the web part, click on web part properties and then mark it hidden (one of the check boxes in the settings)
July 1, 2008 at 5:57 am
Thanks alot for this articale ,and i have a question … in looding this page in your example and set the value of emplyee name automatic so i made this input field disabled by javascript but the sharepoint consider this field is empty ???? meaning , when i make the field disabled sharepoint consider it as empty field any idea ???
July 11, 2008 at 7:26 am
I have tried the steps listed. However, when I try to insert a custom list, it does nothing. I don’t get an error message or anything. I am trying to edit the newform.aspx.
Any ideas?
July 12, 2008 at 3:56 pm
Hey Georgia, are you inserting the custom list into a web part zone?
July 13, 2008 at 7:31 am
Folks, I am trying to mark a field as readonly so the user will not be able to edit it. The field is already populated. Thx
July 20, 2008 at 8:03 pm
Does anyone have any idea how to layout a radio button group for a Choice field in SharePoint so it displays horizontal rather than vertical.
August 28, 2008 at 4:10 am
hi,
i did the following steps to get the custom lis form for a custom list i hvae created
1.Hide the default List Form Web Part from the page.
2.Go Insert > SharePoint Controls > Custom List Form.
3.In the List or Document Library Form dialog, select the appropriate list, content type and type of form.
4. Click OK and a new Data Form Web Part is not added , no error on the page also there is no error in the log files
September 2, 2008 at 12:06 pm
Hi,
I have a strange behavior.
When I try to 1-Hide the default List Form Web Part from the page in the small windows I don’t have the control where you can click hide and all the other stuff but I have the page that get display. I try it on an other list and it work but the list I need to change doesn’t.
On the same list when I tried
2.Go Insert > SharePoint Controls > Custom List Form.
3.In the List or Document Library Form dialog, select the appropriate list
Nothing display in the window with no error but I try the same thing on an other list it work.
How can I fix my list to be able to create custom page to add, edit and display my data ?
Thanks,
Eric
October 24, 2008 at 6:14 am
Thanks for this posting. I am using and it does exactly what I wanted and it is easy to do.
I have one question someone might be able to help with. I am using this technique to create a custom display form. In my DispForm, I have a field that is a multi-select people field. It is displaying the HTML code instead of rendering it. How do I need to configure that field so it renders the HTML properly?
October 24, 2008 at 11:45 am
I answered my own question in case anyone else stumbles across this.
The display field needs to contain ‘disable-output-escaping=”yes”‘.
Example:
October 24, 2008 at 11:47 am
Example in last comment should be as follows within the tags for the field to be displayed:
xsl:value-of select=”@FieldName_x0020″ disable-output-escaping=”yes”/
December 25, 2008 at 4:19 pm
well, hi admin adn people nice forum indeed. how’s life? hope it’s introduce branch
February 25, 2009 at 1:31 pm
I’m having the same problem as someone mentioned before. I’m trying to insert a New Item Custom List Form on a dispform.aspx of another list. Data Views and List Forms work fine inserting them in the display form, but when I try to insert the New Item Custom List form it is displayed in Sharepoint Designer but not in the browser… I get the following error:
“Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor such as Microsoft Office SharePoint Designer. If the problem persists, contact your Web server administrator.”
Not really informative…. I thought it would be something with the Data Source and the GUIDs but everything seems to be OK…
March 24, 2009 at 10:30 am
Hello Henry,
Enjoyed the site and information you have displayed. I do have one question if I may.
Have you had any luck editing the Master pages, such as People and Groups? I want to add more fields to these poeple and groups as well as be able to sort like a list by department? If this cannot be done, then how about I like Active Directory from a list so it can populate the name, department and title and I can pull in pictures of their ugly mugs. What do you think Henry? Any ideas.
Also, the trip to Korea blog was most interesting. Never been there myself though. Would like to bike ride across the country perhaps.
Thanks
Clayton
November 16, 2009 at 1:33 pm
How come you don’t answer your cell phone anymore? ARe you still alive?
April 1, 2009 at 10:21 am
Hi,
Good information!
I have used the same method for custom list edit & new forms.
I have strange problem when I have a column of type spuser with people picker control the check names button does not function.
Any info will be helpful!!!
Thanks,
April 2, 2009 at 6:12 pm
Hi,
I’d like to know how to control the date & time validation on the web?
thx
Wong
April 2, 2009 at 8:32 pm
Hey Wong,you can probably use a custom event receiver to check for validation.
April 3, 2009 at 12:51 am
Thx Henry
Basically, the javascript as below can only handle the date validation. But, it cannot handle date and time validation in SP.
function PreSaveAction()
{
var date1 = getTagFromIdentifierAndTitle(“INPUT”,”DateTimeFieldDate”,”Start Date”);
var date2 = getTagFromIdentifierAndTitle(“INPUT”,”DateTimeFieldDate”,”End Date”);
var arrDate1 = date1.value.split(“/”);
var useDate1 = new Date(arrDate1[2], arrDate1[1]-1, arrDate1[0]);
var arrDate2 = date2.value.split(“/”);
var useDate2 = new Date(arrDate2[2], arrDate2[1]-1, arrDate2[0]);
if(useDate1 > useDate2)
{
alert(“The End Date cannot happen earlier than the Start Date”);
return false; // Cancel the item save process
}
return true; // OK to proceed with the save item
}
function getTagFromIdentifierAndTitle(tagName, identifier, title) {
var len = identifier.length;
var tags = document.getElementsByTagName(tagName);
for (var i=0; i < tags.length; i++) {
var tempString = tags[i].id;
if (tags[i].title == title && (identifier==”"||tempString.indexOf(identifier)==tempString.length-len)) {
return tags[i];
}
}
return null;
}
April 6, 2009 at 12:17 pm
I’ve created a custom list form. Now I’ve added new fields to the actual list. Anyone know how to go about displaying/adding these new fields to my custom list form?
April 7, 2009 at 8:37 pm
Hey Al, you should be able to add the new fields by dragging it in from the list’s data source.
April 16, 2009 at 10:14 am
Hello Henry,
I will be very grateful if you can help me on this one. I have had a look at your guide and i cant get it too work. When i click “Custom List Form”, i then select the list or library i require. When i click okay (to import a new item form) … NOTHING HAPPENS. Sharepoint designer doesnt render anything. I have tried allocating a web part zone, everything. It just seems to ignore the command.
Any ideas ?
April 30, 2009 at 11:33 am
I used Sharepoint Designer and did the follwing
-Create a new ASPX page
-Insert Sharepoint Control
-Choose Custom List Form…
-Pick my custom task list and the content type and click OK.
But after this, nothing happened. I mean no code(columns of fields)has been inserted.
Another strange thing is when I open the default edit form aspx for my custom task list, it only shows three genric columns with names such as Name1, Name2, etc. It is totally different from when I run this edit form from IE or Firefox(in which all the columns shown as I expected).
Please let me know why this happened? What might I miss?
thanks
xiaoxiao
May 20, 2009 at 11:09 pm
Hi Steve,
Iam using custom aspx form(developed in vs.net) in content types for edit/desplay. When i edit the list item the form will open but the form fields are not getting binded.
How to bind the form fields when a item is edited
Thanks,
Pravyn
May 22, 2009 at 11:07 am
When editing my form (newform.aspx) in sp designer 2007, I always seem to get the Invalid page URL error even if I don’t make changes to the form. This is exactly what I did, luckily I saved the list as a template to resurrect it when things went bad:
-Open newform.aspx
-Hide listformwebpart (double click, check hide)
-Hit escape (or else the insert menu is greyed out)
-Active area is now the “placeholdermain custom”
-Insert > SP Control > Custom List Form
-Selected Event & New Form
-Form data now displays correctly.
-Clicked SAVE (note, no changes except for inserting the custom list form)
-Got the message: Site Definition Page Warning – Saving your changes will customize a page from the “site definition. Are you sure you want to do this?”
-I have to click YES or else it won’t save.
-Checked my list in the browser and clicked NEW = Invalid page URL error.
Pls help… I’ve recreated this list over 20 times trying different things and it always seems to break. Any help is much appreciated!
May 22, 2009 at 11:27 am
Soooooo after about 20 tries/rebuilds, I figured out the fix. I’m posting this in hopes I can save someone from ripping their hair out.
Before you try this, please save your list as a template with “save content” checked. I’m 99.9% sure this will work for everyone, but I’m not responsible for any data loss!
-In Designer, create a copy (or copies) of the forms you’re trying to edit.
-Open up the copy (I’ll use newform in this example)
-Click on listformwebpart
-Delete the damn thing
-Follow the instructions above to Insert a new control (you should be within the Main placeholder)
-Make your changes
-SAVE the copy
-Right click on the list in the Folder View > Properties and click on the Supporting Files tab.
-Point “New item form” to the copy you’ve edited and saved.
-Hit Apply.
-Test & relax!
btw, another thing came up, I’m trying to rearrange the order of the form, but some of the fields can’t be cut/pasted. Help?
November 20, 2009 at 10:21 pm
Can’t get the new url to stick. No matter what, it points back to the original file!!! Geez..
June 5, 2009 at 2:37 pm
Microsoft has made the sharepointdesigner 2007 free to download down. I downloaded it with great hopes, but I gues there is only so much available in this free software. I tried adding custom list form but it is grayed out. No matter how I do it, where I click, it is greyed out. Do you have any idea if this is one thing that is not available in the free software.
June 5, 2009 at 2:39 pm
follow the instructions I left above, namely: -Follow the instructions above to Insert a new control [BOLD](you should be within the Main placeholder)[END BOLD]
June 15, 2009 at 12:15 pm
We have a custom list that we created, the list has several columns but would like to only display a subset of those columns to the user and then the full columns be made available to the list owner. I found a way to hide the columns but it hides them for everyone, is there anyway for a site admin or someone to see the full set of columns even though hidden? I cannot find a way to do this. I guess I do not see the benefit of offering a hidden column if no one can ever access it. Seems like should be able to hide from some but not all. Anyone ever run into this issue? Am I missing the obvious? Any help would be apprecated. PS I am new to the MOSS environment.
October 10, 2009 at 8:12 am
More in a moment on the Travertine Question. ,
November 11, 2009 at 5:44 pm
Patti,
Have look at this site:http://www.infoq.com/articles/Dressel-Gogolowicz-wss-security
You can download the code/feature here:
http://code.msdn.microsoft.com/SecureField/Release/ProjectReleases.aspx?ReleaseId=1170
November 19, 2009 at 4:12 am
Will it reflect the columns if i add it newly??
November 20, 2009 at 10:15 pm
No matter what I do… I can’t change the new list form of the supporting files tab. Even when I change the name it sticks to the new name… freaking dumb.
December 14, 2009 at 2:51 pm
When you are changing the default files of a sharepoint list, the menu comes up showing each form (New, Edit, Display) there is a dropdown box that comes up initially as “Folder” much of the time. You must make sure that says “Item”. The “folder” setting will always seem to complete successfully, but no change will be recorded. I think this is a feature, not a bug.. lol
April 21, 2010 at 3:56 pm
Hey IT Cowboy,
I did what you said, but now it won’t take me to the dispform.aspx page when i try it through the URL. Instead it takes me to the EndUserDispForm.aspx which was my customized page always.
How can I fix it so that the browser does not redirect and shows me both pages?
Thanks – IT Girl
March 1, 2010 at 9:56 am
I’m feeling a bit frustrated as I’ve done everything I can think of but I still CANNOT hide the web part in designer. When I right-click and select Web Part Properties I get the following error:
“Operation is not valid due to the current state of the object”
Any suggestions? Please?
March 1, 2010 at 11:44 am
Well after searching and trying multiple things I finally got it to work by tweaking the code.
false
I changed the code from true to false for the WebPart.
March 1, 2010 at 11:46 am
The code was zapped when I posted it so here it is again:
“false”
I changed the code from true to false for the WebPart and the web part is now hidden.
March 1, 2010 at 11:47 am
==false
June 11, 2010 at 4:12 am
If you want to customize the controls that appear on the NewForm.aspx page, and if you do not want to show the default List Form Web Part, you can hide the List Form Web Part. To do this, follow these steps:
Start SharePoint Designer 2007, and then open the NewForm.aspx page for the list.
Right-click the List Form Web Part, and then click Web Part Properties.
Expand Layout, click to select the Hidden check box, and then click OK.