473,287 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Multiple tables sharing same cell IDs - only update one

127 100+
Hi all,

Could someone please tell (remind) me how I can use "document.getElementById('cellID').innerHTML" for a specific cell for a specific table, given that two tables share the same cell ID names, but I only want to update one of them.

Thanks!
May 11 '09 #1
8 2720
Dormilich
8,658 Expert Mod 8TB
an ID must not occur more than once. (it's how IDs are defined). otherwise use classes or names.
Expand|Select|Wrap|Line Numbers
  1. document.getElementsByName(__NAME__)[0]; // first element with a given name
May 11 '09 #2
phub11
127 100+
Thanks for the reply!

So even if I have unique IDs for each table, the cell IDs for both tables cannot be duplicated? Bah!!!!
May 11 '09 #3
gits
5,390 Expert Mod 4TB
it is not 'Bah!!!!' :) ... in case it wouldn't be as it is how should the dom parser find an element by id with:

Expand|Select|Wrap|Line Numbers
  1. document.getElementById('id');
the method always returns one node and in case there are nodes with the same id which one should it choose? ... an id currently has to be unique in one document ...

kind regards
May 11 '09 #4
Dormilich
8,658 Expert Mod 8TB
@gits
I hope that's not gonna changing ever…
May 11 '09 #5
gits
5,390 Expert Mod 4TB
may be you could sometimes use:

Expand|Select|Wrap|Line Numbers
  1. myNode.getElementById('myId');
:) but i know what you mean and i'm with you :)
May 12 '09 #6
acoder
16,027 Expert Mod 8TB
@phub11
You should never need to use duplicate IDs. You can always give it IDs such as "c111" where the first 1 can be the table, the second the row and the third the cell (this is based on what I remember you naming your cells from earlier posts).
May 12 '09 #7
phub11
127 100+
Thanks for the replies!

I resorted to "acoder"'s suggestion. I figured that as tables act as parents for their respective cells, it would be logical that prefixing a cell ID with it's parent (table) using document.get would allow duplicate cell IDs. I guess I've quite a bit to learn!
May 12 '09 #8
acoder
16,027 Expert Mod 8TB
Well, they wouldn't be duplicates then, they'd be unique which of course solves the problem.
May 12 '09 #9

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

Similar topics

2
by: RJ | last post by:
We currently send product releases to our customers, and often have to include scripts that need to be ran on the Oracle databases (also do it for SqlServer customers, but we use a different set of...
5
by: sds | last post by:
Hi all - newbie here - tried to find the answer to this question but failed - hope someone here can help. It should be a simple question so maybe I'm making life harder than it needs to be. I...
1
by: Justin | last post by:
What is the best/easiest way to update multiple tables at a time? Can you recommend any tutorials? Thanks, Justin.
9
by: jaYPee | last post by:
I have search a lot of thread in google newsgroup and read a lot of articles but still i don't know how to update the dataset that has 3 tables. my 3 tables looks like the 3 tables from...
8
by: Jason L James | last post by:
Hi all, does anyone know if I can create a dataview from multiple datatables. My dataset is constructed from four separate tables and then the relationships are added that link the tables...
16
by: Randy Harris | last post by:
I was inspired by the recent discussion of returning multiple recordsets to ADO from a stored procedure. (Amazed is probably more accurate). I asked about how to accomplish same with Oracle and...
18
by: Gleep | last post by:
I've searched google intensely on this topic and it seems noone really knows how to approch this. The goal I don't want clients to give out their usernames and passwords to friends, since the site...
7
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is...
0
by: shivapadma | last post by:
i want to know how multiple tables are added to the MS word document using vb.net i wrote following code to insert one table in MS word document using vb.net 1.opened MS word document 2.inserted...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.