473,804 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple tables sharing same cell IDs - only update one

127 New Member
Hi all,

Could someone please tell (remind) me how I can use "document.getEl ementById('cell ID').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 2741
Dormilich
8,658 Recognized Expert Moderator Expert
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 New Member
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 Recognized Expert Moderator Expert
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 Recognized Expert Moderator Expert
@gits
I hope that's not gonna changing ever…
May 11 '09 #5
gits
5,390 Recognized Expert Moderator Expert
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 Recognized Expert Moderator MVP
@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 New Member
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 Recognized Expert Moderator MVP
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
12753
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 scripts for that). Some of the Sql scripts can be quite long, and so we break them out to their own script files and call them all from one main ..sql file, using sqlplus to execute it all. The admin would run the file like:
5
1262
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 use MS Access 2002 - and have numerous tables that I have to paste in the same text string. How can I do it so I don't have to paste 200 times - is there a way to copy my text, highlight the cells I want to paste it into, and then have my text...
1
2577
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
12991
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 northwind database that has an employees, orders, and order details. the following are the 3 tables in my sql database students schyrsem
8
10421
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 together. To make data entry easier I would like to combine selected columns from the four tables onto a single dataview that could be used as the datasource for a datagrid control. The distinct updates, insert ans delete
16
5729
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 got a nudge in the right direction from Mr. Kreft. I promised to provide details once working, so here it is. The code is shown below. My next step is to build this technique into my application. I'm hoping for substantial performance gain. ...
18
3399
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 relies on subscrption fees. Sessions ID's are matched between the browser and the server. So a users can login with same username and password and those sessions are tracked individually. Some suggest create table fields with the session ID...
7
15666
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 there an equivalent property for the DataGridView? I have searched, but have not found one. I would like the user to be able to see all the columns of the table on one screen - thus eliminating the need to use the horizontal scroll bar to view...
0
5286
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 one 3x3 table Dim App As New Word.Application() Dim Doc As Word.Document = App.Documents.Add() Dim oTable1 As Word.Table Dim Range As Word.Range
0
9714
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10350
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10351
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7638
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4311
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 we have to send another system
2
3834
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.