Ver Mensaje Individual
  #3 (permalink)  
Antiguo 21/02/2006, 20:33
Avatar de Cap.Buscapina
Cap.Buscapina
 
Fecha de Ingreso: octubre-2004
Ubicación: Argentina
Mensajes: 836
Antigüedad: 20 años, 5 meses
Puntos: 4
hola Davhira,

Te dejo el codigo que estuve haciendo.

Cita:
<html>
<head>
<script>
function punto(e,d){
tecla=(document.all) ? e.keyCode : e.which;
if(tecla==39 || tecla==46 || tecla==13 || tecla==9){
document.getElementById('decimales').focus();
return (tecla==46)?false:true;
}else{return true;
}
}
</script>
<style type="text/css">
<!--
.in-medio {
margin-right: 0px;
margin-left: 0px;
border-top-width: thin;
border-bottom-width: thin;
border-top-style: solid;
border-right-style: none;
border-bottom-style: solid;
border-left-style: none;
border-top-color: #000000;
border-bottom-color: #000000;
text-align: right;
}
.in-dcha {
margin-top: auto;
margin-right: 0px;
margin-bottom: auto;
margin-left: 0px;
border-top-width: thin;
border-right-width: thin;
border-bottom-width: thin;
border-left-width: thin;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: none;
border-top-color: #000000;
border-right-color: #000000;
border-bottom-color: #000000;
border-left-color: #000000;
text-align: left;
}
.in-izq {
margin-top: auto;
margin-right: 0px;
margin-bottom: auto;
margin-left: 0px;
border-top-width: thin;
border-right-width: thin;
border-bottom-width: thin;
border-left-width: thin;
border-top-style: solid;
border-right-style: none;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #000000;
border-right-color: #000000;
border-bottom-color: #000000;
border-left-color: #000000;
}

-->
</style>
</head>

<body>
<form name="form1" method="post" action="">
onkeydown <input name="moneda" type="text" class="in-izq" onclick="document.forms[0]['enteros'].focus();" value="$" size="1"><input name="enteros" type="text" class="in-medio" onkeypress="return punto(event)" size="8"><input name="p" type="text" class="in-medio" style="width:3px;" size="1" value="." onclick="document.forms[0]['enteros'].focus();"><input name="decimales" type="text" id="decimales" class="in-dcha" onclick="if(document.forms[0]['enteros'].value==''){document.forms[0]['enteros'].focus();}" size="3">

</form>

</body>
</html>
aunque le faltan pulir algunas cosas (no se por que no toma la tecla tab,no va en opera, le faltaría una validacion para numeros, etc).

espero que te sirva

saludos.

pd: haciendo este script me desayuné de que el numero asignado a cada tecla depende del evento que la invoque (no es lo mismo onkeypress, que onkeydown y onkeyup).
__________________
by Capitán Buscapina
.