Cita:
Iniciado por Javier01
tu código dice:
document.getElementById(inputid).value =hora+":"+minutos+":"+segundos;
Que es ese "inputid"?
este es el input
Código HTML:
<input type="text" id="hora1[]" name="hora1[]" value="">
el check
<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"
onKeyPress="return devolverhora(hora1)"/></td>
Estoy segun yo usando
onkeyPress supongo q mal... pero no quiero el OnClick ya que meto los datos con un lector y da automatico el enter asi que yo doy clic
<script>
function marcar(){
//El Try es para evitar caidas si el elemento no existe
try{
document.getElementById('check' + document.getElementById('ID').value).checked=true;
SUPONGO Q AQUI VA EL CODIGO
}catch(e){
}
}
$("input#ID").remove();
</script>
ESTE ES EL SCRIPT para el enter
<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
return false;
}
else{
return true;
}
}
</script>