var bookRate = new Array('The Right to differ', 'Issues In Contemporary Documentary', 'Writing, Directing and Producing', 'Lee Kuan Yew My Lifelong Challenge');
var selection = document.rate.checkbox;
var sum = 0.00 ;
for (i=0; i<selection.length; i++)
if (selection[i].checked == true)
alert('Book Name : ' + bookRate[i] + ' \n Price of the book : ' + selection[i].value )
alert('Total Purchased Books : ' + selection[i].value );
That's what my current code looks like.
I'm wondering how to calculate the total when two checkboxes are checked?
This function only displays the selected item.