Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 9th, 2004, 05:04 AM
RossC0 RossC0 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 15 RossC0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Code question

Hi,

Someone asked me to code them a table where they could hide and show rows. I tested both in IE6 and Mozilla 1.5 but they say they can't get my code to work any ideas whats wrong with it:

<SCRIPT LANGUAGE="JavaScript">
// Row Hide function.

function expandcontract(tbodyid,ClickIcon) {
if (parent.document.getElementById(ClickIcon).innerHT ML == "+"){
parent.document.getElementById(tbodyid).style.disp lay = "";
parent.document.getElementById(ClickIcon).innerHTM L = "-";
} else {
parent.document.getElementById(tbodyid).style.disp lay = "none";
parent.document.getElementById(ClickIcon).innerHTM L = "+";
}}
</SCRIPT>

<table border=1 cellpadding=4 CELLSPACING=0>

<tr>
<td onclick="expandcontract('Row1','ClickIcon1')" id="ClickIcon1" style="cursor: pointer; cursor: hand;">+</td>
<td>ROW 1 - HEADER</td>
</tr>

<tbody id="Row1" style="display:none">
<tr><td colspan="2">ROW 1 SubDATA...</td></tr> <tr><td colspan="2">ROW 1 SubDATA1...</td></tr>
</tbody>

<tr>
<td onclick="expandcontract('Row2','ClickIcon2')" id="ClickIcon2" style="cursor: pointer; cursor: hand;">+</td>
<td>ROW 2 - HEADER</td></tr>

<tbody id="Row2" style="display:none">
<tr><td colspan="2">ROW 2 SubDATA...</td></tr> <tr><td colspan="2">ROW 2 SubDATA1...</td></tr>
</tbody></table>

Reply With Quote
  #2  
Old September 6th, 2004, 03:54 PM
AliIbarguen AliIbarguen is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 2 AliIbarguen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 28 sec
Reputation Power: 0
Talking

Sorry this was a duplicate reply! Still understanding how this forum works

Last edited by AliIbarguen : September 6th, 2004 at 03:56 PM. Reason: accidentally duplicated reply

Reply With Quote
  #3  
Old September 6th, 2004, 03:55 PM
AliIbarguen AliIbarguen is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 2 AliIbarguen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 28 sec
Reputation Power: 0
You have spaces in the JavaScript - in the words 'innerHTML' and 'display'. I took those out and ran the code like a charm. Thanks, by the way. I was looking for a code snippet to do exactly that!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Code question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway