Reg Visibility of tables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajendra423
    New Member
    • Feb 2008
    • 1

    Reg Visibility of tables

    I have two tables (t1,t2) and onebutton b1 in my page

    For the first time,t2 should be invisible.Afetr clicking b1,t2 should be visible and t1 should be invisible

    I wrote code like this

    [HTML]<html>
    <head>
    <script language="javas cript">
    function enable()
    {
    document.getEle mentById('x').s tyle.display='' ;
    }
    </script>
    </head>
    <body>
    raju is a good boy
    <form method="POST" name="form1" >
    <table>
    <tr>
    <INPUT type="text" name="id">EmpID </input>
    <INPUT type="submit" name="button1" value="Edit" onClick="enable ()"></input>
    </tr>
    <table id="x" style="display: none;">
    <input type="submit" name="b1" value="result">
    </table>
    </form>
    </body>
    </html>[/HTML]


    With this code iam able to make t2 invisible and then if iam clicking button b1 t2 is not visible

    Please help me
    Iam in urgent need of this
    Last edited by gits; Feb 21 '08, 09:41 AM. Reason: added code tags
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    [html]<html>
    <head>
    <script language="javas cript">
    function enable(a,b)
    {
    document.getEle mentById(a).sty le.display='';
    document.getEle mentById(b).sty le.display='non e';
    }
    </script>
    </head>
    <body>
    raju is not a good boy
    <form method="POST" name="form1" >
    <table id="y">
    <tr><td>
    <INPUT type="text" name="id">EmpID </input>
    <INPUT type="submit" name="button1" value="Edit" onClick="enable ('y','x')"></input>
    </td></tr></table>
    <table id="x" style="display: none;"><tr><td>
    <input type="submit" name="b1" value="result" onClick="enable ('x','y')">
    </td></tr></table>
    </form>
    </body>
    </html>[/html]

    Please keep your HTML clean and well formed.

    Comment

    Working...