I have a checkbox in a form and I\'d like it to work according to following scenario:
totalCost
If you are using jQuery.. then I can suggest the following: NOTE: I made some assumption here
$('#my_checkbox').click(function(){ if($(this).is(':checked')){ $('input[name="totalCost"]').val(10); } else { calculate(); } });