473,466 Members | 1,294 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Is it possible to grab a parent node/element?

76 New Member
This is an example of what I'm trying to accomplish but anyway..


<table id="myTable1">
<tr>
<td><input type="checkbox" onClick="doSomething(this)" value="1"/></td>
<td>One</td>
</tr>
<tr>
<td><input type="checkbox" onClick="doSomething(this)" value="2"/></td>
<td>Two</td>
</tr>
</table>


Right now I have some javascript that on click checks to see if the checkbox is being checked or unchecked and runs another function based on this. What I want to do now is to grab the table row and copy its contents to replicate in another table. Basically "You have the following selected" type of thing.

If it's easy to grab a parent node I'll continue with this idea otherwise I'll chuck it and force people to actually possibly remember what they've checked already.
Feb 8 '07 #1
2 4757
Arielle
76 New Member
myRow = this.parentNode.parentNode works so nevermind :D
Feb 8 '07 #2
dmjpro
2,476 Top Contributor
if want to grab value =============== one or two
then try this code .......

tab_id = document.getElementById('myTable1')
row_no = this.parentElement.parentElement.rowIndex
tab_id.rows[row_no].cells[1].value ==== will be value u want
Feb 9 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Philipp Lenssen | last post by:
I'm looking for a way to grab *all* XML of a DOM node (in PHP5). Something like the following, only it doesn't work! Thanks. /* I want everything (all XHTML) in <div id="hell=">...</div> */ ...
12
by: Jeff Lanfield | last post by:
First of all, I apologize if coalescing is not the right term to describe my problem. I have a tree where each node has the same set of attributes (is the same entity) but child nodes should...
4
by: titanandrews | last post by:
Hi, I have ran into a situation that I think should be possible, but I am fairly new to XSLT so maybe not. Suppose I have the following document <ROOT> <FOO name="A"> <CHILD name="B"/>...
5
by: Logos | last post by:
I'm having trouble with this in IE; annoyingly it works beautifully in FF. My keywords are not specific enough to narrow my search to useful entries on google, way too many hits, so here I am...
4
by: patrizio.trinchini | last post by:
Hi all, I'm new to XSLT and maybe my problem have a very trivial answer, but I need an expert that point me in the right direction. What I would obtain is to remove all the elements that have a...
8
by: David | last post by:
I wonder if someone could tell me where I am going wrong with this script. The original implementation of finding a DL list and separating it by dt | dd groups and making new DL's from them worked...
0
by: Guzeppi | last post by:
Hi, i'm using linq to load an xml structure into my classes. the xml consists of the same node nested for multiple levels e.g. <node id="node_id01" name="node 01"> <node id="node_id0101"...
1
by: bnchs | last post by:
This is C code. I am trying to fill each node's Parent field with its parent because I am drawing nodes to the screen. However, I have not been able to get this working. Reading the output from the...
5
by: goldenteeplanet | last post by:
void reverse( node * & s) { // NOTE: YOU CAN NOT MOVE DATA FROM ONE NODE TO ANOTHER // YOU CAN ONLY MOVE POINTERS FROM ONE NODE TO ANOTHER //...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.