Ver Mensaje Individual
  #5 (permalink)  
Antiguo 27/12/2012, 01:33
dark_17
 
Fecha de Ingreso: noviembre-2012
Ubicación: Villa Maria, Peru
Mensajes: 46
Antigüedad: 11 años, 5 meses
Puntos: 0
Respuesta: "Ver mas" en un campo tipo text php mysql

Lo estaba probando, y me funca y despues de segundos desaparece y cambia la url a:

http://localhost:9090/APARTLIMA4RENT/create_nota.php?data_table_length=10

asi no tiene que ser porque yo llevo mis datos por GET a esa pagina y mi url tiene que ser

http://localhost:9090/APARTLIMA4RENT/create_nota.php?reserv=18

Debido a que sucede eso? le dejo el codigo

Código HTML:
 <form class="tableName toolbar">
											<table  class="display data_table8 " id="data_table">
                                                  <thead>
                                                      <tr>
                                                                                            
                                                         <th width = "150" align="center"  width="1" >ACCION</th>
                                                         <th align="center" width="100">CODIGO</th>
                                                         <th align="center" width="1" ></th>
                                                         <th width="400">MENSAJE</th>
                                                                                            
                                                         <th align="center"  width="1" ></th>
                                                         <th align="center" width="200">FECHA/NOTA</th>
                                                         <th align="center"  width="1" ></th>
                                                         <th align="center"  width="1" ></th>
                                                 											
                                                       </tr>
                                                   </thead>
                                                   <tbody>
                                                          <?php
                                                            
										if ($notas == 0) {
                                                    } else if ($notas > 0) {
                                                    foreach ($notas as $info) {
														$Informacion= $info[mensaje_nota];
														$i = 0; 
                                       ?>
										
                                          <tr>
                                          	<td   align="center">
                                       <span class="tip " >
                                          <a onclick="return anular();" href=ctr_anularnota.php?note=<?php echo $info['idnota'];?> title="Anular">
                                              <img src="images/icon/icon_delete.png" >
                                          </a>
                                      </span>
                                            </td>
                                            <td  align="center"><?php echo $info['id_reservacion'] ?></td>	
                                            <td  align="center" width="1"></td>	
                                            <td >
                                            <b class="red"><?php echo '<div name="Contenedor">'.nl2br($info['mensaje_nota']).'</div>' 
											
											?>
                                            <div>
                                                <button data-Indice="<?php echo $i; ?>" onclick="VerMas(this);">Ver más</button>
                                            </div>
                                            </td>		
                                            
                                            <td  align="center" width="1"></td>	
                                            <td  align="center"><?php echo $info['fecha_nota'] ?></td>
                                            
                                            <td  align="center" width="1"></td>	
                                            <td  align="center" width="1"></td>	
                                          </tr>
										
        <?php
		$i++; // Incrementa el índice.
    }
	
}
?>
                                       </tbody>
                                    </table>
                                  </form> 

Y el javascript que uso es el que me dio, osea este:
Código:
<script type="text/javascript">
				
				var Contenedores;
				var Informacion;
				var ObtenerInfo = function()
				{
					// Una vez cargada la página se llamará a ésta función.
					
					var LongitudInformacionResumida = 40;
					var i = 0;
					
					// Cargas los contenedores.
					
					Contenedores = document.getElementsByName('Contenedor');
					Informacion = new Array();
					
					while(Contenedores[i] != null)
					{
						/*
						* Almacenas la info de cada contenedor en un array aparte
						* Luego asignale a cada contenedor su substring;
						*/
						Informacion[i] = Contenedores[i].innerHTML;
						Contenedores[i].innerHTML = Informacion[i].substring(0, LongitudInformacionResumida);
						i++;
					}
				}
				var VerMas = function(Boton)
				{
					// Aquí asignas la info completa a través de cada botón "Ver más".
					var Indice = parseInt(Boton.getAttribute('data-Indice'));
					Contenedores[ Indice ].innerHTML = Informacion[ Indice ];
				}
				window.addEventListener('load', ObtenerInfo,'false');
</script>