How do I add additional logic to a input (buttons) click event?

Sometimes you need to add additional logic to a existing buttons 'click' event. The code to add extra logic to the item (without overwriting the existing code) is as follows:

1. Store the elements click event in a variable

var clickEvent = $("input[id='MyButtonId']").click

2. Overwrite the existing 'click' function, but execute the saved clicked function.

$("input[id='MyButtonId']").on('click', function() {  eval(clickEvent); MyNewSaveMethod();} );

Comments

Popular posts from this blog

SharePoint 2013: Error updating managed account credentials

Error deploying Nintex workflow: An item with the same key has already been added