0

I create the list when user open that item after that he edit this item i want to perform custom code on that how to get this click event?enter image description here

2
  • Do you need to perform custom code after user clicked on edit item or do you need to programmatically trigger edit item from JS code? Commented Nov 22, 2016 at 8:46
  • I need to perform custom code after user clicked.
    – Admin
    Commented Nov 22, 2016 at 9:28

2 Answers 2

3

Based on your description , I think you don't need to care about Edit Button,

  • Just open your editform.aspx page in a new window ,
  • Edit your page
  • Add script editor.
  • Add your code.

Once you click Edit button , it should now show editform.aspx then the custom code at script editor should be run.

Meanwhile, If you are using SSOM via C# you can develop an EventReceiver before item updated SPItemEventReceiver.ItemUpdating to handles the synchronous event that occurs before an item is changed.

Check an example at Developing an Event Receiver for the ItemUpdating event

1
  • I follow your step and add the this code which post by siddharth $("a[id='Ribbon.ListForm.Display.Manage.EditItem-Large']").click()
    – Admin
    Commented Nov 22, 2016 at 13:12
1

But as per my analysis, this might not work. because ribbon elements are being control by ribbon framework which is loaded at client side.Enabling/disabling, redirecting etc will be overridden by this in whatever case you do.

Though for sake of question, you can use below code to bind jquery click event to that button.

    $("a[id='Ribbon.ListForm.Display.Manage.EditItem-Large']").click(function() {
  alert( "Handler for .click() called." );
return false;
});
0

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.