0

According to the following

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.webcontrols.richhtmlfield.hasinitialfocus(v=office.14).aspx

the focus is set to the first occurrence of RichHtmlField no matter it's place with respect to other controls and it causes the page to scroll down if the control is down at the bottom.

How can this behavior be avoided if it is not required to focus on any field when page is loaded using custom page layout.

1

1 Answer 1

2

I created a little script to put focus where I wanted it on opening a publishing page in edit mode. The code is:

function waitUnitStuffIsLoaded() {setTimeout(function(){refocus()},1000);}
function refocus(){$("input[Title='Title']").focus();}   
SP.SOD.executeOrDelayUntilScriptLoaded(waitUnitStuffIsLoaded, "sp.ui.spellcheck.js");

http://pirateeric.sharepointspace.com/blog/Lists/Posts/Post.aspx?ID=18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.