473,387 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

hi, <div style="visibility:hidden" id="hid"> is not working in table

hi,
i am working on <div> i have to hide some part of the table. I am not able to hide that table part can anybady tell me where is the error.
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3.  
  4.             <script type="text/javascript">
  5.              function callme(){
  6.                   document.getElementById("hid").style.visibility="visible";
  7.               }
  8.              function hideme(){
  9.                   document.getElementById("hid").style.visibility="hidden";    
  10.              }
  11.            </script>
  12.  
  13. </head>
  14. <body>
  15. <form name="myform">
  16.  
  17. <table width="100%"  border="4" cellpadding="2" cellspacing="2">
  18.         <tr>
  19.             <td  class="tableheader" colspan="9">TS </td>
  20.         </tr>
  21.      <div style="visibility:hidden" id="hid">
  22.         <tr>
  23.             <td width="17%" class="labeltext">Tran Code</td>
  24.             <td width="1%"  class="blanktext">:</td>
  25.             <td colspan="4" class="blanktext">Name</td>
  26.         </tr>
  27.         <tr>
  28.             <td width="17%" class="labeltext">Product Type</td>
  29.             <td width="1%"  class="blanktext">:</td>
  30.             <td colspan="4" class="blanktext">
  31.             </td>
  32.         </tr>
  33.      </div>
  34.         <tr>
  35.            <td>
  36.            </td>
  37.         </tr>
  38.  
  39. </table>
  40.  
  41. <input type="button" onclick="callme()" value="show">
  42. <input type="button" onclick="hideme()" value="hide">
  43.  
  44. </form>
  45. </body>
  46. </html>
  47.  
  48.  
  49.  
thx,
Ajay
Aug 22 '07 #1
1 6404
acoder
16,027 Expert Mod 8TB
Tip: For your code tags, add =html or =javascript for the nice syntax colour-coding!

To solve this problem, get rid of the div and move the style and id attributes to the rows. Try this:
[HTML]<html>
<head>

<script type="text/javascript">
function callme(){
document.getElementById("hid").style.visibility="v isible";
document.getElementById("hid2").style.visibility=" visible";
}
function hideme(){
document.getElementById("hid").style.visibility="h idden";
document.getElementById("hid2").style.visibility=" hidden";
}
</script>

</head>
<body>
<form name="myform">

<table width="100%" border="4" cellpadding="2" cellspacing="2">
<tr>
<td class="tableheader" colspan="9">TS </td>
</tr>
<tr style="visibility:hidden" id="hid">
<td width="17%" class="labeltext">Tran Code</td>
<td width="1%" class="blanktext">:</td>
<td colspan="4" class="blanktext">Name</td>
</tr>
<tr style="visibility:hidden" id="hid2">
<td width="17%" class="labeltext">Product Type</td>
<td width="1%" class="blanktext">:</td>
<td colspan="4" class="blanktext">
</td>
</tr>
<tr>
<td>
</td>
</tr>

</table>

<input type="button" onclick="callme()" value="show">
<input type="button" onclick="hideme()" value="hide">

</form>
</body>
</html>
[/HTML]
Aug 22 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ralph Freshour | last post by:
I'm not sure the follow multiple table query is the right way to do what I need to do although it seems to be working: $php_SQL = "SELECT * ". "FROM basics, personal, photos ". "WHERE...
5
by: Andrew DeFaria | last post by:
I created the following .sql file to demonstrate a problem I'm having. According to the manual: If |ON DELETE CASCADE| is specified, and a row in the parent table is deleted, then InnoDB...
4
by: gonzal | last post by:
Hi Dose any body know why a temporary table gets deleted after querying it the first time (using SELECT INTO)? When I run the code bellow I'm getting an error message when open the temp table...
3
by: Dan Williams | last post by:
I'm trying to do a simple alteration to the table design of one of our SQL 2k tables, simply changing an identity row so that its not 'not for replication', and its taking absolutely ages to do so,...
14
by: James A. Donald | last post by:
-- I am just beginning to get into CSS. I like to keep all my html simple and generic looking. I want to use a table, because I have, (gasp) tabular data. I want it to look like a table. Not...
5
by: jedbob | last post by:
I used Adobe Imageready to build a simple rollover navigation bar, where the text will change color on a mouse over. The working example can be found at:...
1
by: Steve | last post by:
Hello, I'm trying to add the same record to two different tables from a form and I'm at my wits end. The record would most likely have a different record ID in each table as the tables are...
3
by: Jason Huang | last post by:
Hi, In our C# Windows Form application, we are using the SQL Server 2000 as the database server. The Database table MyTable has a field RegistrationDate which represents the Date a client comes...
11
by: lenygold via DBMonster.com | last post by:
Hi everybody! This query is supposed to count consecutive years from the current year without OLAP. Input Table: ID DateCol 1 02/01/2006 1 01/01/2006 1 01/01/2005
1
by: filch | last post by:
Hi, I am new to this forum ... so hello to all! I am trying to get a script working which will show or hide a table based on a user checking or unchecking a parent checkbox. This is the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.