Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/06/2011, 18:29
xyzdragoncanon
 
Fecha de Ingreso: marzo-2011
Mensajes: 24
Antigüedad: 13 años, 1 mes
Puntos: 1
Como insertar un valor aun input a traves de javascript

Hola foreros tengo un problema
estoy haciendo una aplicacion pero necesito colocar el valor obtenido en dos inputs a otro por ejemplo

valor del input 1
valor del input 2
entonces

valor dein input3 = input 1 + input 2;

lo he intentado con innerHTML

document.nombre.value = valor input3;

pero no ocurre nada espero y me puedan ayudar e aqui mi codigo de ejemplo;

--------------------------------------------------------------------------------------------------------------------------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>

<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>prueba</title>


</head><body>
<script type="text/javascript">
function valo(){
var nombre = document.getElementById("nombre").value;
var apellido = document.getElementById ("apellidos").value;
alert (nombre+" "+apellido);

var mensaje = nombre + " " + apellido;
document.valore.value=mensaje;

}
</script>
<form method="post" action="prueba.html" name="prueba"><input id="nombre" name="nombre"> Nombre<br>
<br>
<input name="apellido" id="apellidos"> Apellido<br>
<br>
<input name="valore" id="valores" size="40" > Nombre completo
<br>
<input onclick="valo()" value="averiguar" type="button">
</form>

<br>

<br>

</body></html>