Activity Forums Salesforce® Discussions How to call two or more methods on a single click?

  • Ravi

    Member
    July 20, 2016 at 10:04 am

    Hi Tanu,

    • Add semi-colons ; to the end of the function calls in order for them(multiple function) to work.

    <input id="btn" type="button" value="click" onclick="fun1(); fun2();"/>

    • You can create a single function that calls both of those, and then use it in the event.

    function myFunction(){
    fun1();
    fun2();
    }

    <input id="btn" type="button" value="click" onclick="myFunction();"/>

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos