When you edit text in a MultiLineTextField which allows rich text, SharePoint switches to "Format text", every time this happens our custom ribbons disappear (they are added with JavaScript).

The only way to get them back so far is reloading the page. I know, it would be easier to add the ribbons with C# but let's just accept, that this solution would be the last one I can use.

My question is: is there any way to receive an event with JavaScript as soon as the textbox is selected/unselected so I can build the ribbons again?

I know, the performance will suck etc., you don't have to mention that. If something is unclear (my English isn't the best any more I guess), mention it, so I can clear things up.


You can use following jQuery to bind the events.

$(document).ready(function () {
    $('#controlid').bind('blur', function () {
        //hide ribbon on lost focus
    }).bind('focus', function () {
        //show ribbon on focus

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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