Submit Your Article Forum Rules

Results 1 to 2 of 2

Thread: JS Hide/Show function not working in NS

  1. #1
    Junior Member
    Join Date
    Mar 2004
    Posts
    3

    JS Hide/Show function not working in NS

    Hi! I have this page with two drop down lists showing trips. Depending on which trip is chosen another drop down list appears showing the dates for that trip. However, I have come accross two problems.
    1. Can anyone tell me how to get the code to work in Netscape?

    2. When I select a trip from the first box, I get the date drop down list. But when I select another trip in that box or the second box, the first date drop down is not cleared and the new drop down is just set over it.

    Here is a page example:
    http://www.lahddah.com/test/hide_show.htm

    Here's the script - (it's long, but I don't know how to make it shorter)
    ----
    function whatTripSelected(){

    var selectValDom = document.forms['trip_table'].elements['tripDom'].options;
    var selectValInt = document.forms['trip_table'].elements['tripInt'].options;
    if (selectValDom.value == 'Salmon River Whitewater Adventure') {
    document.getElementById('salmon_table').style.visi bility='visible';
    //document.getElementById('chpaytype_table').style.v isibility='hidden';
    }else{
    document.getElementById('salmon_table').style.visi bility='hidden';
    }
    if (selectValDom.value == 'Snake River Whitewater Adventure') {
    document.getElementById('snake_table').style.visib ility='visible';
    //document.getElementById('chpaytype_table').style.v isibility='visible';
    }else{
    document.getElementById('snake_table').style.visib ility='hidden';
    }
    if (selectValDom.value == 'Owyhee River Whitewater Expedition') {
    document.getElementById('owyhee_table').style.visi bility='visible';
    //document.getElementById('chpaytype_table').style.v isibility='visible';
    }else{
    document.getElementById('owyhee_table').style.visi bility='hidden';
    }
    if (selectValDom.value == 'Weekend Rafting Getaway') {
    document.getElementById('weekend_table').style.vis ibility='visible';
    //document.getElementById('chpaytype_table').style.v isibility='visible';
    }else{
    document.getElementById('weekend_table').style.vis ibility='hidden';
    }
    if (selectValDom.value == 'Multi-Sport Adventures in Idaho') {
    document.getElementById('multi_table').style.visib ility='visible';
    //document.getElementById('chpaytype_table').style.v isibility='visible';
    }else{
    document.getElementById('multi_table').style.visib ility='hidden';
    }
    if (selectValDom.value == 'Steelhead Fishing Adventure') {
    document.getElementById('steel_table').style.visib ility='visible';
    //document.getElementById('chpaytype_table').style.v isibility='visible';
    }else{
    document.getElementById('steel_table').style.visib ility='hidden';
    }
    if (selectValDom.value == 'Exploring the Outdoors of Idaho') {
    document.getElementById('explore_table').style.vis ibility='visible';
    //document.getElementById('chpaytype_table').style.v isibility='visible';
    }else{
    document.getElementById('explore_table').style.vis ibility='hidden';
    }
    if (selectValInt.value == 'Adventures in Costa Rica') {
    document.getElementById('costa_table').style.visib ility='visible';
    //document.getElementById('chpaytype_table').style.v isibility='visible';
    }else{
    document.getElementById('costa_table').style.visib ility='hidden';
    }
    if (selectValInt.value == 'Sea Kayaking in Baja') {
    document.getElementById('baja_table').style.visibi lity='visible';
    //document.getElementById('chpaytype_table').style.v isibility='visible';
    }else{
    document.getElementById('baja_table').style.visibi lity='hidden';
    }
    if (selectValInt.value == 'Multi-Sport Adventures in Baja') {
    document.getElementById('multi2_table').style.visi bility='visible';
    //document.getElementById('chpaytype_table').style.v isibility='visible';
    }else{
    document.getElementById('multi2_table').style.visi bility='hidden';
    }
    if (selectValInt.value == 'Galapagos Islands Wildlife Cruise') {
    document.getElementById('galapagos_table').style.v isibility='visible';
    //document.getElementById('chpaytype_table').style.v isibility='visible';
    }else{
    document.getElementById('galapagos_table').style.v isibility='hidden';
    }
    }
    ------------
    Thank you!

  2. #2
    Senior Member eightfifteen's Avatar
    Join Date
    Jan 2004
    Posts
    406
    FYI - It's not working in Safari either.

Similar Threads

  1. Javascript function not working
    By kruser in forum Web Programming Discussion Forum
    Replies: 2
    Last Post: 09-23-2008, 04:03 PM
  2. Show Hide Layer Flickering Problem
    By Kane in forum Graphics & Design Discussion Forum
    Replies: 6
    Last Post: 03-16-2007, 11:24 PM
  3. Help! thumbnail function not working properly
    By Jerry in forum Web Programming Discussion Forum
    Replies: 4
    Last Post: 07-22-2005, 06:49 PM
  4. Show Hide Layers in Netscape
    By nancyj in forum Web Programming Discussion Forum
    Replies: 13
    Last Post: 02-24-2004, 03:17 AM
  5. Show/Hide HTML Content
    By SusieG in forum Web Programming Discussion Forum
    Replies: 2
    Last Post: 12-05-2003, 10:04 AM

Posting Permissions

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