473,390 Members | 1,464 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,390 software developers and data experts.

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

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>
  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>
  13. </head>
  14. <body>
  15. <form name="myform">
  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>
  39. </table>
  41. <input type="button" onclick="callme()" value="show">
  42. <input type="button" onclick="hideme()" value="hide">
  44. </form>
  45. </body>
  46. </html>
Aug 22 '07 #1
1 6405
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:

<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";

<form name="myform">

<table width="100%" border="4" cellpadding="2" cellspacing="2">
<td class="tableheader" colspan="9">TS </td>
<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 style="visibility:hidden" id="hid2">
<td width="17%" class="labeltext">Product Type</td>
<td width="1%" class="blanktext">:</td>
<td colspan="4" class="blanktext">


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

Aug 22 '07 #2

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

Similar topics

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...
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...
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...
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,...
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...
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:...
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...
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...
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
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...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
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,...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.