Copy link to clipboard
Copied
It seems simple enough, but I'm not sure what I'm doing wrong. I want TextFieldIwantvisible1 and TextFieldIwantvisible2 to appear if Dropdown1 or Dropdown2 is selected. But the default is to keep the Text fields hidden. Here's what I have below. Any help or guidance would be greatly appreciated. I've placed the code in the run custom validation script.
var f=this.getField("TextFieldIwantvisible1");
var g=this.getField("TextFieldIwantvisible2");
if(event.willCommit)
{
console.printtln(event.value);
switch(event.value)
{
case "Dropdown1":
f.display = display.visible;
g.display = display.visible;
break;
case "Dropdown2":
f.display = display.visible;
g.display = display.visible;
break;
Default:
f.display = display.hidden;
g.display = display.hidden;
break;
}
}
Get rid of the event.willCommit part, and make sure that the field is set to commit the selected value immediately, and it should work.
If it doesn't, check the JS Console for error messages.
Copy link to clipboard
Copied
Get rid of the event.willCommit part, and make sure that the field is set to commit the selected value immediately, and it should work.
If it doesn't, check the JS Console for error messages.
Copy link to clipboard
Copied
Hello There!
Thank you for your reply. I tried the following, with no luck... I also did not receive any error messages. Is there possibly something wrong with the syntax?
var f=this.getField("TextFieldIwantvisible1");
var g=this.getField("TextFieldIwantvisible2");
{
console.printtln(event.value);
switch(event.value)
{
case "Dropdown1":
f.display = display.visible;
g.display = display.visible;
break;
case "Dropdown2":
f.display = display.visible;
g.display = display.visible;
break;
Default:
f.display = display.hidden;
g.display = display.hidden;
break;
}
}
Copy link to clipboard
Copied
Made a silly mistake just figured it out.. Thank you so much!!
Copy link to clipboard
Copied
Yes, actually, it's "default", not "Default"...
On Sun, Sep 17, 2017 at 6:02 PM, darlyj38956125 <forums_noreply@adobe.com>
Find more inspiration, events, and resources on the new Adobe Community
Explore Now