freddixon Posted March 6, 2006 Share Posted March 6, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/4224-onclick-functions/ Share on other sites More sharing options...
kenrbnsn Posted March 6, 2006 Share Posted March 6, 2006 This has nothing to do with PHP and everything to do with Javascript. Please ask it in the Javascript forum.Ken Quote Link to comment https://forums.phpfreaks.com/topic/4224-onclick-functions/#findComment-14682 Share on other sites More sharing options...
obsidian Posted March 6, 2006 Share Posted March 6, 2006 [!--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 Quote Link to comment https://forums.phpfreaks.com/topic/4224-onclick-functions/#findComment-14685 Share on other sites More sharing options...
Goose Posted March 6, 2006 Share Posted March 6, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/4224-onclick-functions/#findComment-14712 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.