Jump to content
Fórum Script Brasil
  • 0

Ajuda com código


Adilson-Colabore Sistemas

Question

tenho o seguinte código

<html>
<head>
&lt;script type="text/javascript">
function calcula(){
desconto = document.getElementById("pDesconto").value;
total = window.opener.document.getElementById("pTotal").value;
total = parseFloat(total); desconto = parseFloat(desconto);

totalDes = (total-(total*(desconto/100)));
totalDes = totalDes.toFixed(2);

window.opener.document.getElementById("pTotald").value = totalDes;
}
</script>
</head>

<body>
<div class='item'><h5>total:</h5>
<input type='text' name='pTotal' id='pTotal' size='6' value='0'> <b id='ok'>*</b><br>

<div class='item'><h5>Desconto:</h5>
<input type='text' name='pDesconto' id='pDesconto' size='6' value='0' > <b id='ok'>*</b><br>
</div>
<div class='item'><h5>Total com desconto:</h5>
<input type='text' name='pTotald' id='pTotald' size='6' value='0' onblur="calcula()"> <b id='ok'>*</b><br>
</div>
</body>

</html>

ele não faz nada. oque está errado?

não conheço muito javascript, então se vocês puderem me ajudar...

Edited by Adilson-Colabore Sistemas
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...