Solved

Retrieve value of table cell...

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

734 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