Text Field Populates Text Hint When Item Selected from Drop Down Menu
Hi Adobe Community,
I would like a text field to populate a text hint when I select a particular option from a pull down menu. I want the text hint to appear grey when that option is selected and I want it to disappear once the user starts to type in the text field (and return in grey if the text field is left blank). And when the user starts to type in the text field, I want the text to be black. If the user selects any other option in that pull down menu, the text hint shouldn't appear at all.
I'm pretty sure I need to do on focus/on blur events in the text field, similar to what I have done for a Check Box, but I just can't seem to come up with the right script to make it happen for a drop down menu instead. I'm also guessing the 'default' verbiage might need to be removed since this text field has no default text? Thanks in advance!!
// On focus, Run a Javascript //
if (event.target.value==event.target.defaultValue) {
event.target.value = "";
event.target.textColor = color.black;
}
// On Blur, Run a Javascript //
if (event.target.value=="") {
var ckbox = this.getField("Delivery");
if (ckbox.value === "Off") {event.target.defaultValue = "";}
else if (ckbox.value === "Recover") {event.target.defaultValue = "Order#";}
else if (ckbox.value === "Ship") {event.target.defaultValue = "Company Name";}
event.target.value = event.target.defaultValue;
event.target.textColor = color.ltGray;
}
