Ver Mensaje Individual
  #20 (permalink)  
Antiguo 17/02/2010, 14:16
visona
 
Fecha de Ingreso: febrero-2008
Mensajes: 675
Antigüedad: 17 años
Puntos: 5
Respuesta: click a una imagen

El return lo he colocado por que he leido que necesitaba un return. Estoy intentando ver como hacerlo funcionar sin molestar mucho, pero no lo consigo.
he modificado el codigo ahora me da esto
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<
title>Documento sin título</title>

<
script type="javascript">
function 
PasarId(id){
        var 
imgselect document.getElementById(id);
        
document.getElementById(img).value imgselect;
        
    }
    
    
</script>
<link href="../css/regalo.css" rel="stylesheet" type="text/css" />
</head>

<body class="fondo">
<div class="nada" id="nada">¡Enviale un regalo y gana su atención!</div>
<div class="fondo" id="fondo">

<div class="fondo" id="fondo1">
  <form id="form1" name="form1" method="post" action="">
     <table>
       <tr>
       
      <td>
      
        
        <img src="../images/regalos/beso.png"  alt="1" name="dd" width="65" height="65" id="1" onclick=PasarId('1');  />
      &nbsp;&nbsp;1&nbsp;
      
        <img src="../images/regalos/rosa.png"  alt="2" name="dd" width="65" height="65" id="2" onclick=PasarId('2');  />
      &nbsp;&nbsp;2&nbsp;

      
        <img src="../images/regalos/bombones.png"  alt="3" name="dd" width="65" height="65" id="3" onclick=PasarId('3');  />
      &nbsp;&nbsp;3&nbsp;
      
        <img src="../images/regalos/carta.png"  alt="4" name="dd" width="65" height="65" id="4" onclick=PasarId('4');  />
      &nbsp;&nbsp;4&nbsp;
      
        <img src="../images/regalos/cereza.png"  alt="5" name="dd" width="65" height="65" id="5" onclick=PasarId('5');  />
      &nbsp;&nbsp;5&nbsp;
      
        <img src="../images/regalos/flores.png"  alt="6" name="dd" width="65" height="65" id="6" onclick=PasarId('6');  />

      &nbsp;&nbsp;6&nbsp;
      </td></tr></table>
    
<p>Tu comentario
  <label>
    <input name="img" type="text" id="img" >
  </label>
</p>
    <p>
      <label>

        <textarea name="comentario" id="comentario" cols="45" rows="5"></textarea>
      </label>
    </p>
    <p>
      <label>
        <input type="submit" name="button" id="button" value="Regalar" />
      </label>
    </p>

  </form>
</div>
</div>
</body>
</html> 
Pero me da el mismo error
Código PHP:
PasarId is not defined
function onclick(event) { PasarId("5"); }()(línea 2)
[Break 
on this errorPasarId("5"); 
A ver si con esto te oriento mejor.
Gracias