Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am looking for code to Enable / Disable table from a image. At first only back ground image should display when we run program for the first, after clicking on image a table should appear(like username(txt & lbl) and password(txt & lbl) with two buttons clear login), if we click on image again it shod disappear. I have done some coding, but it display with image when we run for the first. I am totally new to this javascript and mvc I kindly request to help me out...

HTML
<html xmlns="http://www.w3.org/1999/xhtml" >
<head  runat="server">
<title>FillTest</title>
<script type="text/javascript" src="../../Scripts/jquery-1.4.1.js"></script>
<script type="text/javascript">
//   $('#divTable').hide();
//   $('#tblTable').hide();

window.onload = h();
     
function hd() {
    if ($('#tblTest').hide() == false) {
        function disableTable() {
            $('#tblTest').hide();
        }
    }
    else {
        function enableTable() {
            $('#tblTest').show();
        }
    }
}
</script>
</head>
<body  önclick="hd();" style="height: 735px" background="../../Content/Image/untitled.bmp" style="height: 605px">
    <div>
        <form action="" accept="post"  önload="hd();" style="margin-left: 2px; width: 975px; margin-right: 0px; height: 4px; margin-bottom: 0px;">
             <br />
            <div id="divTable" önclick="hd();" style="width: 363px; height: 188px;">
    <script type="text/javascript">
    window.onload = $('#tblTest').hide();
    $('#tblTble').focus() = false;
    </script>
                <table id="tblTest" style="width: 97%; left=315; height: 152px; table-layout: auto; border-collapse: separate; 131px: ;" bgcolor="#DCFCF2" >
                    <tr class="style3">
                        <td bgcolor="Black" önclick="h();">
                            Login Here:
                            <input type="button"  önclick="h();" value="X" style="height: 22px; width: 21px;" align="top" />
                        </td>
                    </tr>
                    <tr class="style3">
                        <td class="style4">
                            Username: <input type="text" name="uid"  önclick="d();" />
                        </td>
                    </tr>
                    <tr class="style3">
                        <td class="style4" bgcolor="#DFFFFF">
                            Password: <input type="text"  önclick="d();" name="pwd" />
                        </td>
                    </tr>
                    <tr class="style3">
                        <td class="style6" bgcolor="#DFFFFF"> 
                            <input id="Submit1"  önclick="d();" type="submit" value="Login" />
                            <input id="Submit2"  önclick="d();" type="submit" value="Clear" />
                        </td>
                    </tr>
                </table>
            </div>
        </form>
        <form action="" method="post" style="margin-left: 2px; width: 1041px; margin-right: 205px; height: 734px; margin-top: 0px;">
            <input type="image" src="../../Content/Image/untitled.bmp" onclick="hd();"  önload="h();d();" style="height: 737px; margin-left: 0px; width: 1044px;" />
        </form>
    </div>
</body>
</html>


Thank you....
Posted
Updated 23-Mar-13 0:42am
v5
Comments
sri senthil kumar 25-Mar-13 3:46am    
You want to show/hide login form onclick of a image? is thats all your requirment?

1 solution

Hope this solves, if you have any queries in using this reply.

HTML
<html>
<head>
</head>
<body>
<form>
    <table id="loginTable" style="display: none;">
        <tr><td>Load your form here</td></tr>
    </table>
    <img src="http://crm-online.ho.ua/img/admin_login_icon.png">
     onclick="ToggleLoginForm();" style="width: 40px; height: 40px;" />
</img></form>
<script>
function ToggleLoginForm()
{
    var tableObj = document.getElementById('loginTable');
    if(tableObj.style.display == 'none')
     tableObj.style.display='';
    else
     tableObj.style.display='none';
}
</script>
</body>
</html>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900