Page 1 of 1

pass a cell value

Posted: Tue Aug 15, 2006 7:02 am
by shiranwas
hi,

I am having a page with a table which is created dynamically. I have 2 problems
one is how to identify which row the user clicks and send the cell value to a new page

thanks in advance

Posted: Tue Aug 15, 2006 7:18 am
by MarK (CZ)

Code: Select all

<a href='page.php?value=<?php echo $value; ?>'>text</a>
Or - if you want to be sure user can't change the value - send just the row id and do another query on the second page.

Posted: Tue Aug 15, 2006 7:46 am
by patrikG

Code: Select all

<script language="javascript">
function changeText(tdObj){
  window.location="mypage.php?cell="+tdObj.id;
}
</script>
<table>
  <tr>
    <td id="row_1_cell_1" onClick="changeText(this)">text</td>
    <td id="row_1_cell_2" onClick="changeText(this)">text</td>
  </tr>
</table>
note: this is untested, but should work in principle.

edit: moved to clientside.