Jump to content

onclick() functions


freddixon

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.
Link to comment
https://forums.phpfreaks.com/topic/4224-onclick-functions/
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
Link to comment
https://forums.phpfreaks.com/topic/4224-onclick-functions/#findComment-14685
Share on other sites

Archived

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

×
×
  • Create New...

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.