Is there a way to modify this script so that I can add a quantity option to the selected check boxes. I want the buyer to be able to choose more than one of whatever they check off (preferably via a dropdown) and have the script still give the accurate total at the bottom. Here is the script I am using.
Quote:
<script>
function round(number,X) {
// rounds number to X decimal places, defaults to 2
X = (!X ? 2 : X);
return Math.round(number*Math.pow(10,X))/Math.pow(10,X);
}
function addUp(){
total = 0;
for(x=0; x<document.form1.elements.length; x++){
if(document.form1.elements[x].checked == true){
total += parseFloat(document.form1.elements[x].value);
document.form1.chargetotal.value = round(total,2);
document.form1.total.value = '$' + document.form1.chargetotal.value;
}
}
}
</script>
|
I'm open to using a completely different script if it will have the same funcionality.
Your Help is MUCH appreciated.