By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,747 Members | 1,778 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,747 IT Pros & Developers. It's quick & easy.

Define a Function. Please,please Help me!

P: 1
I need a function derived from:

Expand|Select|Wrap|Line Numbers
  1. javascript: myLightWindow.activateWindow({href: \''. DIR_WS_IMAGES. $product_info['products_image'] .'\', title: \'Waiting for the show to start in Las Vegas\', author: \'Jazzmatt\', caption: \'Mmmmmm Margaritas! And yes, this is me...\', left: 300});" value="Launch it from this Button!" />
and has to be triggered by this(or similar):
Expand|Select|Wrap|Line Numbers
  1. <select id="products_id" name="products_id" onchange="\'\', myLightWindow.activate(this.options[this.selectedIndex].value)"></select>
My work so far is
Expand|Select|Wrap|Line Numbers
  1.  <script type="text/javascript">
  2.    products_id = function () {
  3.     var links = $$('.products_id');
  4.     links.each(function(link) {
  5.         Event.observe(link, 'change', function() {myLightWindow.activate(null, link);}, false);
  6.         link.onchange = function() {return false;};
  7.     });        
  8. }
  9. </script>
  10.  
  11.  
i know I am wrong somewhere but I am not an javascript expert, so I do not see it.
The functions is triggered but the value from the select is not passed to the function.
Nov 1 '07 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
What does the activate method expect as arguments?
Nov 2 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.