I've done it before, but now I'm bumbling.
Need to change text field based on option selected in list menu.
What have I done wrong? Please, need quick answer!
<script language="JavaScript" type="text/javascript">
function whichTest() {
if(document.getElementById('rank').option.selected.value = "Private" || "PFC" || "LCpl" || "Cpl" || "Sgt" || "GS01" || "GS02" || "GS03" || "GS04" || "GS05" || "GS06" || "GS07" || "GS08")
{
document.getElementById('whichTest').value = "EmpTest";
} else {
document.getElementById('whichTest').value = "SupvTest";
}
}
</script>
Need to change text field based on option selected in list menu.
What have I done wrong? Please, need quick answer!
<script language="JavaScript" type="text/javascript">
function whichTest() {
if(document.getElementById('rank').option.selected.value = "Private" || "PFC" || "LCpl" || "Cpl" || "Sgt" || "GS01" || "GS02" || "GS03" || "GS04" || "GS05" || "GS06" || "GS07" || "GS08")
{
document.getElementById('whichTest').value = "EmpTest";
} else {
document.getElementById('whichTest').value = "SupvTest";
}
}
</script>