473,698 Members | 1,997 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 2730
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
12742
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
1255
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
2572
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
12978
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
10399
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
5720
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
3388
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
15652
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
5277
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
8671
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
8598
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
9016
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...
0
7709
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5858
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4360
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4613
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3037
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
3
1997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.