Hiding Row (javascript-php-html-css)

Discussion in 'PHP' started by coool, Aug 12, 2007.

  1. coool

    coool New Member

    Joined:
    Jul 12, 2007
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    0
    what do you think of this code? - it's not working what's wrong with it !

    PHP:
    <script type="text/javascript">
    function Show(e)
    {
            if(document.getElementById(e).style.display == 'none')
            {
                    document.getElementById(e).style.display = 'block';
            }
    }
    </script>

    <tr id='criteria1'>
            <?echo CriteriaRow();?>
     //this function have some form elements/html similar to the picture in one of my posts
    </tr>

                  <input type="button" value="Display Criteria" onClick="Show('criteria1');">
    Code:
    #criteria1
    {
    display: none;
    }
    
    when i click on the button.. nothing appear !
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    You'll have to put the style for the TR inline, like this

    HTML:
    <tr id='criteria1' style="display:none"> 
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice