Jump to content

Archived

This topic is now archived and is closed to further replies.

freddixon

onclick() functions

Recommended Posts

Hi,

Quick question for anone who knows more about PHP / Javascript than me.

I have a line of code as below in one of my PHP files:

echo "<select name='left' id='left' size='1' onChange='get-flag_middle(left.value)'>";

Can I add a second / third action to this line so that I have got onChange='xxxx' onChange='yyy' etc?

If not how can I do it?

Thanks a lot.

Share this post


Link to post
Share on other sites
This has nothing to do with PHP and everything to do with Javascript. Please ask it in the Javascript forum.

Ken

Share this post


Link to post
Share on other sites
[!--quoteo(post=352126:date=Mar 6 2006, 01:00 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Mar 6 2006, 01:00 PM) [snapback]352126[/snapback][/div][div class=\'quotemain\'][!--quotec--]
This has nothing to do with PHP and everything to do with Javascript. Please ask it in the Javascript forum.

Ken
[/quote]

moving this to the javascript forum...

to answer your question, though, all you'd have to do is treat the action within the onclick call as normal code:
[code]
<a href="whatever" onclick="function1(); function2(); function3();">whatever</a>
[/code]

hope this helps

Share this post


Link to post
Share on other sites
That is correct. Basically you just have to add a semi-colon after every call. So you can do other things beside calling a function. You can set variables or use logic.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.