Hola
Paquillo
Veamos si te he entendido bien:
Código PHP:
<html>
<head>
<script type="text/javascript">
function editar(obj) {
document.forms[0]['refe'].value = obj.getElementsByTagName('td')[1].innerHTML;
document.forms[0]['precio'].value = obj.getElementsByTagName('td')[2].innerHTML;
}
</script>
</head>
<body>
<table>
<tr onclick = "editar(this)">
<td>Producto 1</td><td>Referencia 1</td><td>precio 1</td>
</tr>
<tr onclick = "editar(this)">
<td>Producto 2</td><td>Referencia 2</td><td>precio 2</td>
</tr>
<tr onclick = "editar(this)">
<td>Producto 3</td><td>Referencia 3</td><td>precio 3</td>
</tr>
</table>
<form>
<input type="text" name="refe" />
<input type="text" name="precio" />
</form>
</body>
</html>
Saludos,