walkerrv
06-30-2005, 09:01 PM
The following script on here is causing me problems.
I have a check box which calculates values based on criteria which I won't go into.
However I need it to calculate two fields and it isn't working on the second field. I originally had it working but not the way I needed, it was parsing the integers as strings and concatenating them instead of adding them. I tried parseInt() but only got errors here.
If someone can take a look and let me know what I can do to make it actually calculate that would be great.
The red Text is the one that isn't working properly.
Thanks,
<script type="text/javascript">
function zeroPack() {
if (document.getElementById('nopack').checked == true) {
document.getElementById('pack').value = 0;
} else {
document.getElementById('pack').value = Math.ceil(document.getElementById('invacv').value * .06);
}
document.getElementById('kkcode').value = document.getElementById('invacv').value + document.getElementById('pdi').value + document.getElementById('pack').value;
}
</script>
I have a check box which calculates values based on criteria which I won't go into.
However I need it to calculate two fields and it isn't working on the second field. I originally had it working but not the way I needed, it was parsing the integers as strings and concatenating them instead of adding them. I tried parseInt() but only got errors here.
If someone can take a look and let me know what I can do to make it actually calculate that would be great.
The red Text is the one that isn't working properly.
Thanks,
<script type="text/javascript">
function zeroPack() {
if (document.getElementById('nopack').checked == true) {
document.getElementById('pack').value = 0;
} else {
document.getElementById('pack').value = Math.ceil(document.getElementById('invacv').value * .06);
}
document.getElementById('kkcode').value = document.getElementById('invacv').value + document.getElementById('pdi').value + document.getElementById('pack').value;
}
</script>