Display problem in firefox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Parz
    New Member
    • Nov 2006
    • 8

    Display problem in firefox

    Hi am new to javscript.Am trying to display a row when a radio button is clicked and hide some oother row whena button is clicked.Using style.display.I t works fine in IE but creates probem in Firefox..Please help me
  • dswethar
    New Member
    • Nov 2006
    • 65

    #2
    Originally posted by Parz
    Hi am new to javscript.Am trying to display a row when a radio button is clicked and hide some oother row whena button is clicked.Using style.display.I t works fine in IE but creates probem in Firefox..Please help me
    Hi Parz,

    Can you post the function here? We can have a better idea.

    Comment

    • ivosilva
      New Member
      • Oct 2006
      • 17

      #3
      You should really post some code, but anyway, your problem might be that you use the display property like this:

      to show:

      style.display = "block";

      to hide:

      style.display = "none";

      but that doesn't work for elements such as TR because the default display of a TR element is not block.

      You should use instead:

      to show:

      style.display = "";

      to hide: (it's the same)

      style.display = "none";

      I advise you to use style.visibilit y along with style.display.

      Hope this helps!

      Cheers...

      Comment

      • Parz
        New Member
        • Nov 2006
        • 8

        #4
        Hey this is the function that i used to change the display
        Code:
        function overseas()
        {
        
        document.getElementById('Country').style.display= this.checked?'none':'inline';
        document.getElementById('th1').style.display = this.checked?'none':'inline';
        document.getElementById('State').style.display = this.checked?'inline':'none';
        document.getElementById('City').style.display = this.checked?'inline':'none';
        document.getElementById('th2').style.display = this.checked?'inline':'none';
        document.getElementById('th3').style.display = this.checked?'inline':'none';
        }

        Comment

        • Parz
          New Member
          • Nov 2006
          • 8

          #5
          Hey thanks..I replaced the block wid blank..that seems to work...
          Thanks a lot

          Comment

          • deisedallagnol
            New Member
            • Sep 2008
            • 1

            #6
            Me ajudou mt tb!! Parabéns!

            Comment

            Working...