www.webdeveloper.com
Results 1 to 3 of 3

Thread: Call two javascript functions on onclick

  1. #1
    Join Date
    Jun 2013
    Posts
    3

    Call two javascript functions on onclick

    I would like to put a button in a aspx page calling two JavaScript functions.
    So I added the code :

    Code:
    <a onclick="javascript:'registerTraining();confirmRegisterTraining()';" class="btn orange height_19 submit"><span>SEND</span></a>
    RegisterTraining function sends an email to register for a training to an internal service
    ConfirmRegisterTraining function sends an email to the user for confirmation of the request.

    I wanted to know how to make a call 2 functions ?
    Is that the first function is executed and after the second function ?
    Do you have any specific recommendations ?
    I did a search but not found much info on it.

    Thanks.

  2. #2
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,111
    I'd recommend something like this:

    Code:
    <a onclick="registerTrainingAndConfirm()" class="btn orange height_19 submit"><span>SEND</span></a>
    Code:
    function registerTrainingAndConfirm() {
    	registerTraining();
    	confirmRegisterTraining();
    }
    You're basically creating a new function which calls the two others.
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

  3. #3
    Join Date
    Jun 2013
    Posts
    3
    Thanks for your return !

Thread Information

Users Browsing this Thread

There are currently 4 users browsing this thread. (0 members and 4 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles