I am trying to make a function that has 2 functions within it. Here it works fine:
var bothFunctions = function(){//combine 2 function variables
checkCats();
checkCatVal();
};
$('#q119').on('change', bothFunctions);
The functions them selves are performing some logic on a drop down list.
I tried using this technique on aother 2 functions that are performing logic based on a checkbox:
var bothFunctions = function(){//combine 2 function variables
checkPCardCheck;
checkPCardVal;
return false;
};
$('#q34 .cf-table-add-row').click(bothFunctions);
What am I missing? Are there ever special conditions where you can't combine functions?
I can get them to work when I break them into separate lines:
$('#q34').on('change', checkPCardCheck);
$('#q34').on('change', checkPCardVal);
I also tried combining them like this with no luck:
$('#q34 .cf-table-add-row').click(function(){
checkPCardCheck();
checkPCardVal();
return false;
});
I am a noob, so please forgive any blatantly obvious reasons that I don't see.
Thanks