i have this jquery code:
<script type='text/javascript'>
$(window).load(function(){
$('input:checkbox').change(function(){
var tot=200;
$('input:checkbox:checked').each(function(){
dat=$(this).val();
tot-=parseInt(dat);
});
if (tot < "20") {
alert("You dont have any money!");
for(i = 1; document.getElementById("bifa" + i) !== null; i++) {
if (document.getElementById("bifa" + i).checked)
{
} else {
document.getElementById("bifa" + i).disabled = true;
}
}
}
$('#outputDiv').html("You have: " + tot + " RON")
});
});
</script>
What it does, is subtract from a total sum a certain amount. You can see it working here
I just added a dropdown select on every row and is enabled when the checkbox next to it is checked. You can see that after the checkbox and the select dropdown is a number, representing the amount of money that will be subtracted from total sum. I want, when i select from the dropdown a certain value x2 or x3 the value of the checkbox will be multiplied by 2 or 3 depending on the selection and the from the total sum to be subtracted. For example if i check column NOV WED 28/row 06-07 and select x2, the the output should be “You have 200 - (30x2)=140” and if i uncheck the input box to reverse the operation.
So can you help me solving this?
I changed your sample, here is modifed: http://jsfiddle.net/abaLA/