Jump to content


Photo

onclick() functions


  • Please log in to reply
3 replies to this topic

#1 freddixon

freddixon
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 06 March 2006 - 05:48 PM

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.


#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 06 March 2006 - 06:00 PM

This has nothing to do with PHP and everything to do with Javascript. Please ask it in the Javascript forum.

Ken

#3 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 06 March 2006 - 06:03 PM

[!--quoteo(post=352126:date=Mar 6 2006, 01:00 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Mar 6 2006, 01:00 PM) View Post[/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:
<a href="whatever" onclick="function1(); function2(); function3();">whatever</a>

hope this helps
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#4 Goose

Goose
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts
  • LocationOregon

Posted 06 March 2006 - 06:52 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users