Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 30th, 2003, 08:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post
Default Display detail table but don't overlap items below

I am having a problem trying to describe my problem. The current layout of my webpage is as follows:

Accessed By: Branch, Cindy
Show Hide Print Detail Report

Accessed By: Britton, Sandra
Show Hide Print Detail Report

Accessed By: Gowan, Linda
Show Hide Print Detail Report

When I click on "Show" for Branch, Cindy the detail, which is created by a loop in my ASP code is displayed but covers up the following lines where I want the table to display but the rest of the lines to be pushed down.

I am not familiar enough with JAVASCRIPT to know how to do this and any help would be appreciated. Thank you.

Here is my current javascript code:

<style type="text/css">
.tablehider
    {
     visibility: hidden;
     position: absolute
    }
</style>
<script type="text/javascript" language="JavaScript1.2">
<!--
function show(obj){
    if(typeof obj == "string")
        obj = document.getElementById(obj);
    obj.style.visibility = "visible";
}

function hide(obj){
    if(typeof obj == "string")
        obj = document.getElementById(obj);
    obj.style.visibility = "hidden";
}
//--></script>

In my ASP code this is where I am using the JS above:

This first part displays the SURROGATE NAME:

strWebLogActivityTable2 = strWebLogActivityTable2 & "<td align='left' valign='bottom'><b>Accessed By: &nbsp;&nbsp;" & trim(strsurrogateuser) & "<br><a href=""javascript:void(0)"" onclick=""show('"+strsurrogateuser+"')"">Show</a>&nbsp;&nbsp;&nbsp;<a href=""javascript:void(0)"" onclick=""hide('"+strsurrogateuser+"')"">Hide</a></b></td>" & vbcrlf

THIS SECOND PART starts the table of my detail:

strWebLogActivityTable = "<TABLE width='650' border='1' cellpadding='0' cellspacing='0' id='"+strsurrogateuser+"' class='tablehider' bgcolor='white'>" & vbcrlf
 
Old July 30th, 2003, 09:03 AM
Authorized User
 
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It's because of the position:absolute.

Change the CSS to:

.tablehider{
   display:;none
}

And the JavaScript to:

obj.style.display = "none";

or

obj.style.display = "block";


/Robert
 
Old July 30th, 2003, 10:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post
Default

Robert,

That was the ticket.
Thanks so much for your time and help on this!!



Quote:
quote:Originally posted by robnym
 It's because of the position:absolute.

Change the CSS to:

.tablehider{
display:;none
}

And the JavaScript to:

obj.style.display = "none";

or

obj.style.display = "block";


/Robert





Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript - display items in listbox matching the sansircar ASP.NET 1.0 and 1.1 Professional 1 February 6th, 2007 07:04 AM
display random items from xml file rahimzai XML 2 November 26th, 2006 06:47 PM
Master Detail Table Prob dinq11 SQL Language 0 October 17th, 2006 07:41 PM
Retrieving items from a table - Immediate Help badprogrammer Access VBA 2 May 4th, 2005 02:39 PM
Database overlap leion SQL Server 2000 4 May 24th, 2004 08:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.