私は次の比較演算子を機能させようとしています。2番目の'if'は、常にコード内の次のステートメントを実行します。私が欲しいのは、eithentryTypeまたはfollowupEntryTypeが文字列「LongTermCare」と等しくない場合に検出できるようにすることです。コードは次のとおりです。
function getComboB(sel) {
var value = sel.options[sel.selectedIndex].value;
if (value == "Rehab") {
if (!(document.getElementById('entryType').value == "Long Term Care") || !(document.getElementById('followupEntryType').value == "Long Term Care")) {
document.getElementById('followupEntryType').value = "Long Term Care";
alert("short-term rehab code");
return true;
} else {
alert("long-term rehab code");
return true;
}
}
}