What is wrong with this JS coding?

Discussion in 'JavaScript' started by Christian Little, Aug 2, 2008.

  1. #1
    I'm working on a job board for a client, and I thought it was going well until IE started giving me issues.

    What the script does is asks the user to select a Province, and when they do it unhides a drop-down menu for them to select a specific city.

    Works perfect in Firefox, does nothing in IE.

    There's 2 JS functions:

    cloak - sets a div's class to "hidden"
    uncloak - sets a div's class to "visible"

    Cloak seems to work fine in IE (as the 'please select a province' message disappears when you select a province) but it's not unhiding the div that is supposed to show.

    Link: http://www.workdiscovery.com/newposting.php

    Any insights?
     
    Christian Little, Aug 2, 2008 IP
  2. david_t

    david_t Member

    Messages:
    74
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    #2
    I think you should try setting element property style.display to none
    document.getElementById('myID').style.display = 'none';
    Code (markup):
    when hiding and to block
    document.getElementById('myID').style.display = 'block';
    Code (markup):
    when showing. I'm not sure if this is the best solution but it works for me.
     
    david_t, Aug 3, 2008 IP
  3. Christian Little

    Christian Little Peon

    Messages:
    1,753
    Likes Received:
    80
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for trying, I couldn't get it to work with about a dozen different solutions so we went with a different process :)
     
    Christian Little, Aug 3, 2008 IP