Solved

Retrieve value of table cell...

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to go to Web page 2 97
Menu Inconsistent 3 33
Windows Tool to Build Android and iOS App 3 53
Angular2 app not loading Bootstrap properly 4 8
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

910 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now