I have created a html/css website with different pages, it is a menu and I would like to add checkboxes which add up the total of what they wish to order. As all other aspects of the menu are separate I would like this to be separate so I have created another page and assigned values to each check box and the total works when its on the same page nut not when on different, is there any way to overcome this?
This is the code:
<script type="text/javascript">
function checkTotal() {
document.listForm.total.value = '';
var sum = 0;
for (i=0;i<document.listForm.choice.length;i++) {
if (document.listForm.choice[i].checked) {
sum = sum + parseInt(document.listForm.choice[i].value);
}
}
document.listForm.total.value = sum;
}
</script>
<input type="checkbox" name="choice" value="8.99" onchange="checkTotal()"/>£8.99<br/>
on another page
<p>The Total Of The Order is: <input type="text" size="2" name="total" value="0"/>
Please help and if it isn't obvious I am a beginner