I want to add custom actions to my save or check-in buttons when a page is in edit mode.

The IDs from the buttons I want to add events:


The only button event that gets fired is the ctl00_PageStateActionButton button. All other ribbon buttons are not working.

Tried following code:

$('#id').on("click", function(e){});
$('body').on("click", "#id", function(e){});
$('body').delegate("#id", "click", function(e){});

Also tried the IDs with "\" and without before each "." But nothing worked.

  • How are you presently trying to add this? – Graham Jun 25 '15 at 15:33
  • With jquery as I posted. But I beleive it is not possible that easy, because Sharepoint is always overwriting my event registration – Florian Leitgeb Jun 29 '15 at 9:19
  • I meant what method are you using to add this jQuery to the site? Where are you adding this? Via Visual Studio/solution, master page, web part on the page or SP Designer? – Graham Jun 29 '15 at 15:41
  • Just on the page... Used executeFunc callback after loading sp.js and also tried the add_pageLoaded callback to make sure everything is ready. But it is not working. – Florian Leitgeb Jun 30 '15 at 9:26
  • Are you just putting this in a script editor webpart? – Graham Jun 30 '15 at 14:45

Your Answer

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

Browse other questions tagged or ask your own question.