how to get overrid of not implemented problem in IE -window.onload

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sarvanhsr
    New Member
    • Jan 2010
    • 8

    how to get overrid of not implemented problem in IE -window.onload

    To visible Drop down box onload if it has value;
    Code:
    function enableDrop(s)
    {			
         if(document.getElementById(s).value != 0)
         {
            document.getElementById(s).style.visibility ='visible';
         }
            return null;
    }
    Script:

    Code:
    window.onload = enableDrop('ageCaffeinatedCoffee');
    It works fine in Firefox and had problem only in IE
    Last edited by Dormilich; Jan 9 '10, 12:36 PM. Reason: Please use [code] tags when posting code
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    your onload syntax is wrong, it’s
    Code:
    window.onload = function_name;
    otherwise you have to use an anonymous function
    Code:
    window.onload = function()
    {
        myFunction("x");
    }
    everything else is browser curtsy.

    Comment

    • sarvanhsr
      New Member
      • Jan 2010
      • 8

      #3
      Thanks..

      but it works in firefox but not in IE

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        is the function executed at all (test with an alert call on the first line)?

        Comment

        Working...