Create Custom List Form For SharePoint List【1】
1.Create a new form for sharepoint list with many fields you want via sharepint designer.
2.Create relevent application form for your list.
3. Copy the source code of form you created before to your new page in VS and adjust as below




4.Use SPUtility , SharePoint JS function and Jquery to hand field value and layout.
a.SharePoint Function :_spBodyOnLoadFunctionNames,This array allows you to register additional JavaScript methods that should run in the body onload event.
Example _spBodyOnLoadFunctionNames.push('functionName'); _spBodyOnLoadFunctionNames.push('functionName("functionArgument")');
b.SharePoint JS Function:PreSaveAction(),fired when onClick event handler is fired for Save button, allows to override behavior for a Save button. It is commonly used for client side validation.
c. SPUtility JS: Get/Set field Value and Description,Show/Hide field.Enable/Disable fileld.
5.Handle Ribbon for your page in diffierent mode.
a.Display

b.Edit

c.Display

6. Mapping your pages to list definition.
a.Move your pages to your list difinition folder.
b.Set the deployement type with "Element File".

c. Modify List Definition Project Item Data.

d.Modify List Definition Schema


浙公网安备 33010602011771号