...

View Full Version : Urgent help with Lightwindow, chained selects and Onchage



safuk2233
10-29-2007, 10:34 PM
I am trying to make a function from this:


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!"

my code so far is:


<script type="text/javascript">
products_id = function () {
var links = $$('.products_id');
links.each(function(link) {
Event.observe(link, 'change', function() {myLightWindow.activate(null, link);}, false);
link.onchange = function() {return false;};
});
}
</script>

and I am calling it from

<select id="products_id" name="products_id" onchange="\'\', myLightWindow.activate(this.options[this.selectedIndex].value)"></select>
The above select is populated from a database. i got it working with dinamyc content but can not get it to work with lightwindow and lightwindow is what I am using.

I do not know if the function is called from the javascript above or from the lightwindow js, all I know is that the page wants to load but the

this.options[this.selectedIndex].value value is not passed along and the page does not load. Just displays Loading.. or Cancel

Please help me, I need this! :confused: :confused: :confused:

A1ien51
10-30-2007, 05:25 AM
What is this: \'\', doing in the onchange? If you are running Firefox, install the Firebug extension and look at the error that pops up in it. [http://www.getFirebug.com]

Eric

safuk2233
10-31-2007, 08:26 PM
What is this: \'\', doing in the onchange? If you are running Firefox, install the Firebug extension and look at the error that pops up in it. [http://www.getFirebug.com]

Eric


Thank you for your answer, the \\ is so it does not mess with the php code (it is in php).
I installed firebug . It says "link has no properties".
which means the value from 'this.options[this.selectedIndex].value' is not posted to the function.

I am wrong somewhere but I can not see where. Maybe you can help me out.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum