Solved

Retrieve value of table cell...

Posted on 2004-03-26
4
583 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
  • 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

770 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