tags:

views:

20

answers:

1

I'm probably doing this all wrong but here goes....

I'm calling a php function with ajax to create a table with three columns. Currently the php function fetches all the data and creates a table which it loads into a div once the function is finished.

The third column can only be created using data from the first two columns.

Is there any way to populate this column automatically with another ajax call?

(i have another php function which i can feed the first two variables into)

Can anyone help???

EDIT: I can't populate the field in the first call - as the function will take significant time to process - i'd like to show the user the progress of this column being populated.

A: 
$('#yourtable tr').each(function(index)){
  var col1=$(this).children('td.col1').text();
  var col2=$(this).children('td.col2').text();
  $(this).children('td.col3').load('yourscript.php?col1='+col1+'&col2='+col2+');
}

try this

Christian Smorra
for this to work i'm going to need unique id's for every row - correct??
Simon
no you just need a an id for your table and you need to add a to a specific column eg<table id="mytable"><tr><td class="col1"></td><td class="col2"></td><td class="col3"></td></tr></table>
Christian Smorra