function updateTotal() { var o = document.getElementById('order'); var ele = document.getElementsByName('level'); var t = 0; if(ele[0].checked) t = 50.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; }