Not much....I do have some javascript code in the page. It gives a total, but it is on the second page. I have a page that, when you click on the button, it takes you to another page. I can get the total on the second page, but not on the first one. Here is the javascript for that part.
}
var num, i, j;
var comm = "";
var comm1 = "";
var comm2 = "";
var comm3 = "";
function Calculate()
{
var total=0;
// calculate each line total
if (document.getElementById('gift_num1').value >= 0){
document.getElementById('GIFT_AMOUNT1').value= (document.getElementById('gift_num1').value ).toFixed(2);
}
if (document.getElementById('gift_num2').value >= 0){
document.getElementById('GIFT_AMOUNT2').value = (document.getElementById('gift_num2').value ).toFixed(2);
}
if (document.getElementById('gift_num3').value >= 0) {
document.getElementById('GIFT_AMOUNT3').value = (document.getElementById('gift_num3').value ).toFixed(2);
}
if (document.getElementById('gift_num4').value >= 0){
document.getElementById('GIFT_AMOUNT4').value = (document.getElementById('gift_num4').value ).toFixed(2);
}
if (document.getElementById('gift_num5').value >= 0){
document.getElementById('GIFT_AMOUNT5').value = (document.getElementById('gift_num5').value ).toFixed(2);
}
if (document.getElementById('gift_num6').value >= 0){
document.getElementById('GIFT_AMOUNT6').value = (document.getElementById('gift_num6').value ).toFixed(2);
}
if (document.getElelmentById('gift_num7').value>=0){
document.GetElementById('GIFT_AMOUNT7').value=(doc ument.getElementById('gift_num7').value).toFixed(2 );
total = parseFloat(document.getElementById('GIFT_AMOUNT1') .value)+ parseFloat(document.getElementById('GIFT_AMOUNT2') .value) + parseFloat(document.getElementById('GIFT_AMOUNT3') .value) + parseFloat(document.getElementById('GIFT_AMOUNT4') .value) + parseFloat(document.getElementById('GIFT_AMOUNT5') .value) + parseFloat(document.getElementById('GIFT_AMOUNT6') .value) + parseFloat(document.getElementById('GIFT_AMOUNT7') .value);
var num= Math.round(total * 100) / 100
document.getElementById('total').value = num.toFixed(2);
}
}
does this help? Like I said, it's been a couple of three years since I had any programming classes.
|