I am building this invoice and I got help from someone in ASP forum, but since he wrote the code in Javascript, I will ask here, maybe someone can help me please:
I want to add a totals at the bottom of the invoice, but dont know how. I dont work with Javascript much, so I have no clue how to get this to work. Code was given to me by someone from Tek-Tips:
<form name="frmINVOICE">
<input name="frmQTY">
<input name="frmDESC">
<input name="frmPRICE" onblur="getTotal(frmINVOICE.frmQTY.value,frmINVOICE.frmPRICE.value)">
<input name="frmTOTAL">
</form>
<script language="Javascript">
function getTotal(val1,val2){
document.frmINVOICE.frmTOTAL.value = val1 * val2;
}
</script>
Basically I have 10 entries and each one has a different name. What I did at the end of the script is this:
function getTotal(val1,val2){
document.frmINVOICE.frmTOTAL.value = val1 * val2;}
function getTotal1(val1,val2){
document.frmINVOICE.frmTOTAL1.value = val1 * val2;
}
function getTotal2(val1,val2){
document.frmINVOICE.frmTOTAL2.value = val1 * val2;
}
so on until I get to 10. What I want is to add an Input box at the bottom of the page where the total would be. Eveything works great but I do not know how to add the last code to make the totals appear. Tried some things, but again I dont work much with Javascript.
THANK YOU FOR YOUR HELP...
I want to add a totals at the bottom of the invoice, but dont know how. I dont work with Javascript much, so I have no clue how to get this to work. Code was given to me by someone from Tek-Tips:
<form name="frmINVOICE">
<input name="frmQTY">
<input name="frmDESC">
<input name="frmPRICE" onblur="getTotal(frmINVOICE.frmQTY.value,frmINVOICE.frmPRICE.value)">
<input name="frmTOTAL">
</form>
<script language="Javascript">
function getTotal(val1,val2){
document.frmINVOICE.frmTOTAL.value = val1 * val2;
}
</script>
Basically I have 10 entries and each one has a different name. What I did at the end of the script is this:
function getTotal(val1,val2){
document.frmINVOICE.frmTOTAL.value = val1 * val2;}
function getTotal1(val1,val2){
document.frmINVOICE.frmTOTAL1.value = val1 * val2;
}
function getTotal2(val1,val2){
document.frmINVOICE.frmTOTAL2.value = val1 * val2;
}
so on until I get to 10. What I want is to add an Input box at the bottom of the page where the total would be. Eveything works great but I do not know how to add the last code to make the totals appear. Tried some things, but again I dont work much with Javascript.
THANK YOU FOR YOUR HELP...