Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Hiding TR when we find value of a childNode
Old 05-20-2006, 07:05 PM Hiding TR when we find value of a childNode
Junior Talker

Posts: 3
Trades: 0
Hi GUYS,

I have been following the forum for quite some time and I have to say it is impresive to find so much usefull information. Time and time again if I got stuck I would come here and find an answer and that is great. Now for this problem, unfortunatelly, I did not find a solution, so I am making this post.

I have an issue with dinamically generated CFML page. The page is working properly but what I am trying to do is use JavaScript to hide some content on this page. Here is a short summary of the JS code and HTML code that is supposed to hide:

function getlost() {
var row = document.getElementsByTagName('select');

for (var i=row.length-1; i>=0; i--) {
var cols = row[i].getElementsByTagName('td');
for (var j=cols.length-1; j>=0; j--) {
if (cols[j].firstChild.nodeValue == 'Security Level:')
{

cols[j].parentNode.style.display = 'none';
}
}
}
}


and HTML:

<TR>
<TD WIDTH="150" VALIGN="TOP" ALIGN="LEFT" NOWRAP>
<FONT FACE="Verdana, Arial, Helvetica, sans-serif" SIZE="2">Security Level:</FONT>
</TD>
<TD WIDTH="100%" VALIGN="TOP" ALIGN="LEFT">

<SELECT NAME="component_2094983">

<OPTION VALUE="A">A</OPTION>
<OPTION VALUE="B" selected>B</OPTION>
<OPTION VALUE="C">C</OPTION>
<OPTION VALUE="D">D</OPTION>

</SELECT>

&nbsp;<FONT FACE="Verdana, Arial, Helvetica, sans-serif" SIZE="2" COLOR="FF0000">*</FONT>

</TD>
</TR>

Any help would be appreciated!
Mungossss is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-20-2006, 08:07 PM Re: Hiding TR when we find value of a childNode
Novice Talker

Posts: 9
Trades: 0
Where are you calling your function? Functions only run if you call them. Use an event to call it like <input type="button" onClick="getLost()">


Hope this helps!
twizler is offline
Reply With Quote
View Public Profile
 
Old 05-20-2006, 08:30 PM Re: Hiding TR when we find value of a childNode
Junior Talker

Posts: 3
Trades: 0
Well, I guess, thanks. I am doing an onload in body tag function calling option.
Mungossss is offline
Reply With Quote
View Public Profile
 
Old 05-21-2006, 10:08 AM Re: Hiding TR when we find value of a childNode
Junior Talker

Posts: 3
Trades: 0
What a retard I am...

Here is the code that solved my problem:

function getlost() {
var row = document.getElementsByTagName('tr');

for (var i=row.length-1; i>=0; i--) {
var cols = row[i].getElementsByTagName('font');
for (var j=cols.length-1; j>=0; j--) {
if (cols[j].innerHTML.indexOf('Security Level:')!=-1)
{

cols[j].parentNode.parentNode.style.display = 'none';
break;
}
}
}
}
Mungossss is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Hiding TR when we find value of a childNode
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13177 seconds with 12 queries