Check if Sharepoint page is in edit mode No ratings yet.

By | July 26, 2016

To check whether the page is in edit mode or not we need to check value of parameter “MSOLayout_InDesignMode“.

Below is the JavaScript snippet using which we can easily check whether the page is in edit mode or not.

This will refer to value of the following html input control, which is rendering on the page when it is in edit mode:

Similary, for Wiki pages  you need to check _wikiPageMode parameter.

var wikiInEditMode = document.forms[MSOWebPartPageFormName]._wikiPageMode.value;

For publishing pages we can also check it using this:

This returns true or false.

 

 

 

 

 

Likes(1)Dislikes(0)

Please rate this

Leave a Reply

Your email address will not be published. Required fields are marked *