@willvin My solution:
$(document).ready(function() {
if($('.modal-open').length) {
var usz = 0;
var gj = 0;
var okm = 0;
var kiu = 0;
$(document).on('change keyup input', 'input[name="gj"]', function(){
gj = $(this).val();
setInput();
});
$(document).on('change keyup input', 'input[name="okm"]', function(){
okm = $(this).val();
setInput();
});
$(document).on('change keyup input', 'input[name ="kiu"]', function(){
kiu = $(this).val();
setInput();
});
function setInput() {
usz = parseInt(gj, 10) + parseInt(kiu, 10) + parseInt(okm, 10);
$('#page-add-form input[name="usz"]').val(usz);
};
}
});
Why work only with $(document)? I don't understand.