Advanced Search

Results 1 to 3 of 3

Thread: Help with multiple onchange events and chained selects

  1. #1
    Join Date
    Mar 2005
    Location
    Western Australia
    Posts
    132
    Thanks
    19
    Thanked 3 Times in 3 Posts

    Default Help with multiple onchange events and chained selects

    Hi guys, I nearly have it working I just have one element not working as it should. I know it is related to the multiple onchanges and the chained selects and the order of how things are applied but I have been unable to work it out and therefore I need your HELP

    I have created two files with the scripts working as much as I can, hopefully you can have a look at the source and go ADD THIS.

    The first is a complete set of what I am trying to do.

    It uses the chained selects script to dynamically generate the select options based on each other.

    On making a selection it should do three things, 1st is change the image, 2nd is change a price value and 3rd change a link. No matter which way I go about it I can only get 2 of 3 working... so what am I missing?

    Link: http://gmwebfiles.com/formtest/index.html

    The second is the same as above but I have removed the link change requirement to show it does work for two of the onchange events, I just need it to work for all three.

    Link: http://gmwebfiles.com/formtest/index2.html

    I am sure there are better ways to structure what I have, and by all means suggest away, but at this stage if I can get it to work that will be enough

    Once it is all working I will pull the scripts out of the actual document and have them all in one single file, with exception to anything that is required to be on the page (if required).

    Thanks

    GW
    1st rule of web development - use Firefox and Firebug
    2nd rule - see the first rule
    --
    I like Smilies

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,675
    Thanks
    43
    Thanked 3,125 Times in 3,091 Posts
    Blog Entries
    12

    Default

    The only serious problem with the first one (gmwebfiles.com/formtest/index.html) is that around line 94:

    Code:
     document.getElementById('cup_price').innerHTML='$'+cupprice+' each';
    The highlighted is not defined. If you change that to:

    Code:
     document.getElementById('cup_price').innerHTML='$'+price+' each';
    It 'works'.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2005
    Location
    Western Australia
    Posts
    132
    Thanks
    19
    Thanked 3 Times in 3 Posts

    Default

    OMG! how did I miss that... two days trying to figure that out.... thanks for finding my own stupid fault.

    Thanks

    GW
    1st rule of web development - use Firefox and Firebug
    2nd rule - see the first rule
    --
    I like Smilies

Bookmarks

Posting Permissions

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