Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Urgent help with Lightwindow, chained selects and Onchage

    I am trying to make a function from this:

    Code:
    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:

    Code:
     <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
    Code:
    <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
    Code:
    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!

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    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
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by A1ien51 View Post
    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.
    Last edited by safuk2233; 10-31-2007 at 09:57 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •