function call on click event

  • dheerhot
  • Novice
  • Novice
  • User avatar
  • Joined: Jan 11, 2009
  • Posts: 34
  • Status: Offline

Post February 22nd, 2009, 11:34 am

hello guys, i m in confusion that can we call more than one function on a single event, example is below...

Code: [ Select ]
<input type="button" name="b1" value="Enter" onclick="return function1();return function2()">
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post February 22nd, 2009, 11:34 am

  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post February 22nd, 2009, 11:55 am

You can call multiple functions within a single event, yes.

You can not however, have multiple returns as you have in your example though.

Here is one possible alternative if your functions return simple boolean values.

Code: [ Select ]
onclick="return (func1() && func2());"
Strong with this one, the sudo is.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: demonmaestro and 130 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.