Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/11/2012, 12:01
Avatar de Briss
Briss
 
Fecha de Ingreso: junio-2011
Mensajes: 1.293
Antigüedad: 13 años, 7 meses
Puntos: 12
Hora de Busqueda en input

Tengo los siguientes script

Código HTML:
<script>
function marcar(){
//El Try es para evitar caidas si el elemento no existe
try{
document.getElementById('check' + document.getElementById('ID').value).checked=true;
}catch(e){
}
}
$("input#ID").remove(); 
</script>



 <script>
  function disable_enter(e){
    var key;
    if(window.event){
        key = window.event.keyCode;
    }
    else{
        key = e.which;
    }
    if(key == 13){
        marcar();
       document.getElementById('ID').value =''; //limpiar input	
	   //document.getElementById('ID').select(); //	Seleccionar texto
	
        return false;
    }
    else{
        return true;
		

    }
	
}
  </script> 
Y el siguiente Formulario

Código HTML:
 <form id="form1" name="form1" method="POST" >
                    <label style="font-size:14px">ID:
                    <input type="text" name="ID" id="ID" onKeyPress="return disable_enter(event)"> 
                    </label>
                    <label>
                    <input type="button" name="buscar2" value="Buscar" onClick="marcar();" />
                    </label>
                    </form> 
Aquí busco un ID si existe en mi tabla (cuyos valores dependen de una consulta previa, se marca o activa mi check)

esta es mi tabla:

Código HTML:
<table border="0" class="normal">
  <td>ID</td>
  <td>Estado</td>

<?php do { ?>
    <tbody>
      <tr>
       <td ><?php echo $row['ID']; ?></td>
    <input name="aplica[]" value="<? echo $row ['ID'];?>" type="checkbox" <?php if($row ['ID'] == $_POST['ID']) echo "checked='checked' "; ?> id="check<? echo $row ['ID'];?>" class="check" /></td> 
   </tbody>
    <?php } while ($row= mysql_fetch_assoc($row)); ?>
Bien ahora tengo que  mostrar la hora en que fue buscado el ID 
<input name="hora[]" value="" type="text"  /></td> 

He leido como obtener la fecha y hora... lo que no tengo idea es como capturar la hora por cada busqueda es decir cuando mi check se marque

Gracias de antemano