Posts

Showing posts from March, 2011

Create a custom list form in SharePoint

Image
This time I'll explain how to create a custom form in SharePoint 2007 . The same example I will explain about "new item" ( New Form ), you can intuitively, in the same way, build a form of editing ( Edit Form ) and a form of view item ( Display Form ). One reason to create a custom form is redesigned, another reason is the function LockDown Feature form STSADM - " Lock Down Feature " is a function for an Anonymous Site as I explained previously . We Knows the "New Form" that comes out of the box in SharePoint (See example screen "New Item" in MOSS 2007 picture below). We want to build a new form. The form that will be a new design and located in different library ( Not in Lists library ) - that the Lock Down Feature will not disturb us to work. First we'll create a copy of the original NewForm.aspx to Pages library . Now will change the name (preferably - not required). You can of course create a new aspx form in SharePoint D...

Add Value from QueryString to SharePoint List Form

Image
This time I will demonstrate how to add content to the field directly to the url path (QueryString) to SharePoint List Form (Only for MOSS 2007). Step one, open form in SharePoint Designer (NewForm.aspx, EditForm.aspx). (You need to Do backup to the form before). Step two, add the following JavaScript code , where you can open a script tag (See an example where I added the code to SPD in the image attached) if ( typeof (_spBodyOnLoadFunctionNames) != "undefined" ) { if (_spBodyOnLoadFunctionNames != null ) { _spBodyOnLoadFunctionNames.push( "SetMyField" ); } else { window.onload = SetMyField(); } } else { window.onload = SetMyField (); } function SetMyField() { var MyField = getURLParam( "MyField" ); var inputs = document.getElementsByTagName( "INPUT" ); for ( var i = 0 ; i < inputs.length- 1 ; i++) { if (inputs[i].title == "My Field" ) { ...