Thursday, April 22, 2010

Enable Ajax in SharePoint on Custom Forms

In order for Ajax to work properly, we need to edit init.js file installed with MOSS 2007 on server. The file is located at: Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033.

Open the file and go to method _spFormOnSubmitWrapper(), the following code will be found in the file:

if (_spSuppressFormOnSubmitWrapper)
{
return true;
}
if (_spFormOnSubmitCalled)
{
return false;
}

Replace the above code with the following code:

if (_spSuppressFormOnSubmitWrapper)
{
return true;
}
if (_spFormOnSubmitCalled)
{

//return false;

}
Note that “return false” statement has been commented out. This will make ajax calls to work properly.


Refrence:

http://fahadkundi.wordpress.com/2009/05/26/enable-ajax-in-sharepoint-on-custom-forms/

No comments:

Post a Comment