<SCRIPT LANGUAGE="JavaScript">
function sumar(uno,dos)
{
var total;
total = parseInt(uno.value)+parseInt(dos.value);
document.getElementById('1').value = total;
//alert("El valor es " + document.getElementById('1').value);
}
</script>
<form method="post" action="ok.jsp" >
<input type="text" id="7" name="precio" value="10">
<input type="text" name="cantidad" value="15">
<input type="text" id="1"name="total" value="" onclick="sumar(precio,cantidad)" readonly>
<input type="submit" value="chao">
</form>
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.