In javasciript, before method call, have a variable (boolean, which will decide if to execute the method) and get value from apex class getter method. The getter method will return TRUE / FALSE depending on the required field vaules.
JavaScript:
var ifToExecute = {!checkCondition};
if(ifToExecute) {
callJsMethod();
}
Apex:
Public boolean getCheckCondition() {
// ToDo: combine your fields condition here and accordingly send response
return true;
}
JavaScript:
Apex:
Thanks,
Ashish Garg
Email: ashish6mains@gmail.com
Mob: +91-8952827377