I have the following code that adds up amounts if checked using a checkbox
it can be seen here http://www.yaketyyakallmouth.com/rad...enew/index.asp
problem is when you have the two selections next to each other we really only want one to be selected so i thought of using radio selectors instead but they use the name to group them together and this is used by the code above to add the amounts together.
any ideas around this
Code:
<script type="text/javascript">
function calculate(f)
{
var nums = f.num;
var ntext = f.num;
var result = 0;
for(var i=0;i<nums.length;i++)
{
if(nums[i].checked)
{
result+=parseFloat(ntext[i].value);
}
}
f.answer.value=Number(result).toFixed(2);
}
</script>
problem is when you have the two selections next to each other we really only want one to be selected so i thought of using radio selectors instead but they use the name to group them together and this is used by the code above to add the amounts together.
any ideas around this
Comment