![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
16/09/2004, 15:40
|
![Avatar de KarlanKas](http://static.forosdelweb.com/customavatars/avatar11549_2.gif) | Moderador extraterrestre | | Fecha de Ingreso: diciembre-2001 Ubicación: Madrid
Mensajes: 6.987
Antigüedad: 23 años, 1 mes Puntos: 61 | |
Prueba con esto: Código HTML: <html>
<head>
<style>
input{
border:none;
position:absolute;
left:50px;
border-bottom:solid 1px #e5e5e5;
text-align:right;
}
#sumador{
position:absolute;
left:200px;
border:solid 1px black;
text-align:center;
}
hr{
border:solid 1px silver;
}
</style>
<title>Untitled</title>
<script>
function sumar(deAqui){
s1=(isNaN(deAqui.sumando_1.value))?0:Number(deAqui.sumando_1.value);
s2=(isNaN(deAqui.sumando_2.value))?0:Number(deAqui.sumando_2.value);
deAqui.resultado.value=s1+s2;
}
</script>
</head>
<body onload="document.forms[0][0].focus()">
<form name="suma">
<input type=text name="sumando_1"><br>
+<input type=text name="sumando_2"><br>
<hr width="185" align="left">
<input readonly align="right" type=text name="resultado">
<input id="sumador" type="button" value="sumar" onclick="sumar(this.form)"<br>
</form>
</body>
</html>
__________________ Cómo escribir
No hay pregunta tonta, sino tonto que quiere seguir en la ignorancia.
Última edición por KarlanKas; 16/09/2004 a las 15:46 |