Ver Mensaje Individual
  #4 (permalink)  
Antiguo 30/04/2011, 21:56
Avatar de gildus
gildus
 
Fecha de Ingreso: agosto-2003
Mensajes: 1.495
Antigüedad: 20 años, 8 meses
Puntos: 105
Respuesta: Desactivar eventos onclick de <img/> y <td>

Holas,

Mas o menos como dice TheoriaX:

Código Javascript:
Ver original
  1. function imagen(id_Img) { //recive id de imagen
  2.     if(document.getElementById('fue_presionado1').value==0){   
  3.         document.getElementById('fue_presionado1').value=1;
  4.         idImagen=id_Img;
  5.         document.getElementById("txtimagen").value= idImagen;
  6.     }
  7. }
  8.        
  9. function celda(id_td){ //recive id de celda
  10.     if(document.getElementById('fue_presionado2').value==0){   
  11.         document.getElementById('fue_presionado2').value=1;
  12.         idCelda=id_td;
  13.         document.getElementById("txtcelda").value=idCelda;
  14.     }
  15. }

Y en el HTML:

Código HTML:
Ver original
  1. <td  id="celda1" onclick="celda(this.id)">
  2.     <img src="imagenes/blanco.jpg" id ="img_c3"/>    
  3.     <input type="hidden" id="fue_presionado1" value="0" />
  4. </td>
  5.  
  6. <td>
  7.     <img src="imagenes/0.JPG" id="imagen_1" onclick="imagen(this.id)"/>
  8.     <input type="hidden" id="fue_presionado2" value="0" />
  9. </td>

Saludos
Gildus
__________________
.: Gildus :.