function call on click event

  • dheerhot
  • Novice
  • Novice
  • User avatar
  • Posts: 34

Post 3+ Months Ago

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()">
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

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());"

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 63 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.