Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 30th, 2003, 08:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Arlington, TX, USA.
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
Reply With Quote
  #2 (permalink)  
Old July 30th, 2003, 09:03 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
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
Reply With Quote
  #3 (permalink)  
Old July 30th, 2003, 10:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Arlington, TX, USA.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:07 PM.


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