function updateTotal() { var o = document.getElementById('order'); var t = 0; t += (o.level0.value * 10000.00); t += (o.level1.value * 5000.00); t += (o.level2.value * 2500.00); t += (o.level3.value * 1000.00); t += (o.level4.value * 500.00); if (o.other.value > 0) { t = parseInt(o.other.value) + t; } document.getElementById('total').innerHTML = 'TOTAL $' + t + '.00'; o.contribution.value = t; return true; } function valForm() { var o = document.getElementById('order'); var req = new Array('first_name', 'last_name', 'address', 'city', 'zip', 'phone_number', 'email', 'cumemberat', 'employedat', 'occupation'); valid = true; for(var f in req) { o[req[f]].style.backgroundColor = '#fff'; if (!o[req[f]].value) { o[req[f]].style.backgroundColor = '#ff0'; valid = false; } } if (!valid) {alert('Please complete any highlighted fields to continue');} if (o.contribution.value == 0) { alert('Please choose at least one contribution level to continue'); valid = false; } return valid; }