- Mon May 10, 2021 4:09 am
#829170
Given a main form named "Employee Info" which includes a subform named, "subform Checklist", which has a dropdown control named "Department Head", how would I set the PLACEHOLDER for "Department Head" via JavaScript?
Explanation of partial trigger code further below:
"departmentHead" is a dropdown on "subform Checklist" with a PLACEHOLDER of "Please select from list"
If they select "yes" for "bannerAccount", select a value from the dropdown for "departmentHead", then set "bannerAccount" back to "no", I clear the value for "departmentHead".
However, this eliminates the "Please select from list" PLACEHOLDER if they later change "bannerAccount" back to "yes",
thus displaying the top value for "departmentHead" by default.
How do I set "departmentHead" back to the PLACEHOLDER value after I clear it?
function showOrHide_bannerAccountDetails() {
if ($("#bannerAccount").getValue() === "yes") {
$("#departmentHead").show();
$("#departmentHead").enableValidation();
$("#accessPrivsLike").show();
$("#additionalBannerAccess").show();
...
} else {
$("#departmentHead").hide();
$("#departmentHead").disableValidation();
$("#departmentHead").setValue("");
...