esto es lo que tengo ahora mismo
Código PHP:
<script type="javascript">
function PasarId(id){
var imgselect = document.getElementById(id);
document.getElementById(img).value = imgselect;
}
</script>
y este es el evento en la imagen
Código PHP:
<img src="<?php echo $row_regalos['img_regalos']; ?>" alt="<?php echo $row_regalos['id_imgregalos']; ?>" name="dd" width="65" height="65" id="<?php echo $row_regalos['id_imgregalos']; ?>" onclick="PasarId('<?php echo $row_regalos['id_imgregalos']; ?>');" />
y este es el campo de texto
Código PHP:
<input name="img" type="text" id="img" >
Pues cuando aprieto la imagen me dice lo que he comentado. Creo que lo tengo bien.