0
<script>
function Sumar() {
var n7 = document.getElementById('txtN7').value; /*Fator tempo*/
var n8 = n7.replace(',','.');
var cem = (n8)/4; /*Calculo de fator*/
var n1 = document.getElementById('txtN1').value; /*100%*/
var n2 = document.getElementById('txtN2').value; /*101%*/
var suma = ((parseInt(n1) + parseInt(n2))*cem); /*Resultado somenta dos valores de 100 e 101*/
var n3 = document.getElementById('txtN3').value; /*95-99%*/
var n4 = document.getElementById('txtN4').value; /*85%-94%*/
var n5 = document.getElementById('txtN5').value; /*75%-84*/
var n6 = document.getElementById('txtN6').value; /*50%-74%*/
var n9 = document.getElementById('txtN9').value; /*No Match*/
var suma1 = (((parseInt(n3) + parseInt(n4)+ parseInt(n5)+parseInt(n6)+parseInt(n9))*n8)+suma);
document.write(suma1);
/* alert("Número estimado em horas: "+suma1) */
}
</script>
Good afternoon guys!!! I need to create an Html5 "Input Text" to print the summary variable of javascript. I used Document.write more when clicking the button it makes a refresh type and shows the value on a blank page. Thanks in advance!!!
<input type="button" onclick="Sumar();" value="Calcular Horas Tradução">
I don’t know if I’m misunderstanding you.... ( sorry I’m new to Html/Javascript). The value of the suma1 variable ( Javascript) is correct only that before it showed the value in an Alert. i need the value to be displayed in a text input ( a text box). Thanks. for replying!!!! Your explanation shows the value of the variable sum in the input?
– Rodrigo Hackz Exploitz
@Rodrigohackzexploitz Yes. Just click on the "Run" button to test the code.
– Valdeir Psr