OK, so I have this great jQuery script that's almost fully functional thanks to some help on these forums. But I have one last piece that's not working as intended. Right now a user can add a course and when they do it updates all the price fields accordingly. This works fine. However when they click the 'Remove' link next to a course they added it doesn't change the price fields as intended, although it does remove the course <select> box. Please look at my code and help me figure out why it's not updating the price fields accordingly. Thank you!!
Here's a link to the page so you can see how it does/n't work, haha:
http://distance.uaf.edu/projects/jquery/regtest.php
Here's the relevant jQuery for removing a course <select> box:
$('a.select_remove').unbind('click').click(function(){
var tuition = document.getElementById('tuitionTotal');
var tech = document.getElementById('techTotal');
var network = document.getElementById('networkTotal');
var total = document.getElementById('courseTotal');
tuition -= parseFloat($(this).attr('rel')) || 0;
if (tech <= 60) {
tech -= 5.00;
} else {
tech -= 0.00;
}
if ($(this).attr('label').charAt(1) < 5) {
network -= 3.00;
} else {
network -= 6.00;
}
total -= tuition + tech + network;
$("span.tuitionTotal").text("$"+tuition.toFixed(2));
$("span.techTotal").text("$"+tech.toFixed(2));
$("span.networkTotal").text("$"+network.toFixed(2));
$("span.courseTotal").text("$"+total.toFixed(2));
$(this).prev('select').remove();
$(this).prev('label').remove();
$(this).remove();
return false;
});