Table Rows Does not display - CSS / DHTML

Posted on 2006-03-19
Last Modified: 2010-05-18
I am using an html form with more than 60 fields to collect our monthly data.
The fields are displayed to the clients as per their login by outputting the class attributes (show or hide) from a server side script.
Sometimes even after the server side script writing the `show` attribute, some rows does not display on the browser (It appears on refresh). This does not happen always. May be 5 or 6 out of 100 times. What could be the reason?

Part of the HTML Code is given below

The class attribute $at1 $at2 etc will be written as "show" or "hide" by the server side script
as per the client login. The styles `show` & hide are given below
hide {
visibility: hidden; display: none; }
show {
visibility: visible; display: block; height: 34px; }
w1 {
text-align: center; border-bottom: solid 1px #333333;}
fd {
text-align: center; background-color: #fffff0;}
A sample of the html is given below. There are total 63 rows. As per the client login,
some rows will be "show" and some "hide"

<tr id="E1" class="<?php echo "$at1"; ?>">
<td colspan="3" class="w1"> Complaints Recd. </td>
<input id="numField1" name="en10" class="fd">

<tr id="E2" class="<?php echo "$at2"; ?>">
<td colspan="3" class="w1"> Complaints Attended</td>
<input id="numField2" name="en2" class="fd">

<tr id="E12" class="<?php echo "$at3"; ?>">
<td colspan="3" class="w1"> Complaints Pending </td>
<input id="numField3" name="en12" class="fd">


I am using an external css by followwing method

<link rel="stylesheet" href="includes/entry_form.css" type="text/css">

Question by:chasun
    LVL 2

    Expert Comment

    Do you need to hide them with dhtml (class="hide"), or can you hide them with php...

    <? if($at1=="show") { ?>
    <tr id="E2">
    <td colspan="3" class="w1"> Complaints Attended</td>
    <input id="numField2" name="en2" class="fd">
    <? } ?>

    The reason you would want to hide them with dhtml is if you want to show them again on the client side.

    You could also try:

    <tr id="E12" style="<?=$at3 ?>">

    and set $at3 as "hidden".

    if you want to unhide it with dhtml, I think you can use this javascript:

    document.getElementById("E12").style.display = 'block';

    Failing all that, you could do the hiding during the body onload (<BODY onload="[codehere]">) and see if the renderer behaves.

    LVL 6

    Accepted Solution

    it could be a caching problem on the browser (or even proxy side -- if they use one)!
    Try adding this HTTP headers to your page response:

    Cache-Control: private
    Pragma: no-cache
    Expires: 0

    Hope this help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Suggested Solutions

    Title # Comments Views Activity
    sumNumber challenge 16 78
    fizzArray  challenge 1 28
    Sql how to exclude from a table 3 60
    wordcount challenge 11 46
    RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now