Try this:
$(document).ready(function () {
$('.pd80, .pd100').on('blur', 'input', computePD80);
function computePD80() {
alert('test begin');
if ($('.chk80 input').is(':checked')) {
alert('true');
var pd100 = parseNumber($('.pd100 input').val());
var chk80 = $('.chk80 input').val().replace(/V_/g,'');
$('.pd80 input').val(chk80 * pd100);
} else {
alert('false');
$('.pd80 input').val('null');
}
alert('end');
}
function parseNumber(n) {
var f = parseFloat(n); //Convert to float number.
return isNaN(f) ? 0 : f; //treat invalid input as 0;
}
});
You will notice that it prompts you on the screen when the function runs, is evaluated, and ends. This helped me identify that you needed to use '.is(':checked')' for the checkbox. You can use the double forward slash to comment out those alerts or just simply remove them after you test everything.
I feel like you may want to add in a line to get the change to happen when the checkbox is marked as well, you can add in this line to the top to add that:
$('.chk80').on('change','input',computePD80);
Or, change the second line to appear like this:
$('.pd80, .pd100, .chk80').on('blur', 'input', computePD80);
EDIT: Also, Eric's post included 'parseNummber' instead of the mentioned function 'parseNumber' which may have added to the items not running properly