Solved

Retrieve value of table cell...

Posted on 2004-03-26
4
586 Views
Last Modified: 2007-12-19
Have a datagrid.  In Javascript I read through the datagrid using a datatable called 'mytable'.
The datagrid has both template and bound columns.  I can read the template column values OK but having trouble reading the text value of the bound columns.  Here is a snippet from the
script that reads the value of the template columns:

      for( x = 1; x < mytable.rows.length; x++ )
            {
                  y=x+1;
                  ctlCBVal=document.getElementById("dgPOItems__ctl"+y+"_ReceiveProduct").checked;
                  ctlRecvQtyVal=document.getElementById("dgPOItems__ctl"+y+"_QtyReceived").value;
                  ctlRefQty=document.getElementById("dgPOItems__ctl"+y+"_QtyRefused").value;
                  ctlPaidPrice=document.getElementById("dgPOItems__ctl"+y+"_PaidPrice").value;


     The bound column is named "QtyOrd" and I'm not exactly sure how to use mytable to extract the value from its cell.

0
Comment
Question by:gsmithaaa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
gronog earned 50 total points
ID: 10697777
you could generate an unique ID tag for each TD of your table, and use it to retrieve your value

document.getElementById('TheIdMayBeForgedByappendingXandYPositions').firstChild.value
0
 
LVL 1

Expert Comment

by:gronog
ID: 10697785
or, if you want to reduce the size of the generated HTML (that is, if you dont want to add an ID tag to each TD,
you could jump from cell to cell using nextSibling...
but that is error prone and less robust.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question