Activity Forums Salesforce® Discussions How to retrieve name of the button that fired the event having buttons reusing the same onclick handler in Salesforce ?

  • shariq

    Member
    September 23, 2018 at 11:15 pm

    Use event.getSource() in the client-side controller to get the button component that was clicked. Call

    getLocalId() to get the aura:id of the clicked button.

  • Parul

    Member
    September 23, 2018 at 11:43 pm

    To retrieve the name of the button that fired the event call getLocalId() to get the aura:id of the clicked button.

    $("button").click(function() {
    var fired_button = $(this).val();
    alert(fired_button);
    });

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Popular Salesforce Infographics