SharePoint Developer Center >
SharePoint Products and Technologies Forums
>
SharePoint - Design and Customization
>
Disable fields in EditForm.aspx
Disable fields in EditForm.aspx
- I have been diabling a few fields in EditForm.aspx. The way I have been doing this is by setting the control mode = display. this thoughs an error if I do it for a date picker. Can anyone tell me the easiest way to disable a date field for editForm.aspx
Answers
- A workaround is that instead of setting the control mode = display, your can format the field as datetime (instead of list form field).
- Marked As Answer byGuYumingMSFT, ModeratorFriday, November 13, 2009 2:03 AM
- You can do it by using Sharepoint designer. either make the field control disable using javascript code or use a custom edit form and render the field as label.
- Marked As Answer byGuYumingMSFT, ModeratorFriday, November 13, 2009 2:03 AM
- Proposed As Answer byGuYumingMSFT, ModeratorSunday, November 08, 2009 8:29 AM
All Replies
- If the list is custom and you are building it with a feature, you can set the ShowInEditForm attribute to false on each field that you do not want to show up. This will prevent the field from showing up when the edit form is sdisplayed without having to change the form itself.
Corey Roth blog: www.dotnetmafia.com twitter: twitter.com/coreyroth - Well, if you simply want to hide fields, this can be done without cracking open sharepoint designer or doing any code.
You have to enable content types in that list or library first. In the list/ library's settings, click "advanced settings"
Change the very first box "allow management of content types" to YES
Then, you'll have a new section in your list's settings, called "content types". You can then click the name of the content type in there, and then click on a field name and change it to hidden.
Laura Rogers, MCSE, MCTS
SharePoint911: SharePoint Consulting
Blog: http://www.sharepoint911.com/blogs/laura
Twitter: WonderLaura - You can do it by using Sharepoint designer. either make the field control disable using javascript code or use a custom edit form and render the field as label.
- Marked As Answer byGuYumingMSFT, ModeratorFriday, November 13, 2009 2:03 AM
- Proposed As Answer byGuYumingMSFT, ModeratorSunday, November 08, 2009 8:29 AM
- A workaround is that instead of setting the control mode = display, your can format the field as datetime (instead of list form field).
- Marked As Answer byGuYumingMSFT, ModeratorFriday, November 13, 2009 2:03 AM
- I dont think I am either writing the javascript correctly because I cant seem to get it to work. Do you possibly have an example?


