function call on click event

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
dheeraj
Forum Commoner
Posts: 40
Joined: Fri Feb 06, 2009 11:54 am

function call on click event

Post by dheeraj »

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

Code: Select all

<input type="button" name="b1" value="Enter" onclick="return function1();return function2()">
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: function call on click event

Post by VladSun »

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

Code: Select all

<input type="button" name="b1" value="Enter" onclick="return function1();return function2()">
I think you want this:

Code: Select all

<input type="button" name="b1" value="Enter" onclick="return function1() && function2()">
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply