Copy link to clipboard
Copied
Could you please help me solve this issue (I'm new to adobe acrobat dc):
Javascript written in textfield1(Color1) - Actions:
var C1 = this.getField("Color1");
var S1 = this.getField("Swatch1");
switch (C1.rawValue)
{
case "PMS 100":
S1.border.fill.color.value = "0,174,239";
break;
case "PMS 101":
S1.border.fill.color.value = "236,0,140";
break;
}
Hi.
You can use this JavaScript (not tested) as a calculation script in the textfield2:
var myField = this.getField("textField1");
if (myField.valueAsString == "AAA") {event.target.fillColor = color.red;}
else if (myField.valueAsString == "BBB") {event.target.fillColor = color.blue;}
else if (myField.valueAsString == "CCC") {event.target.fillColor = color.black;}
// etc.
Copy link to clipboard
Copied
Is this a form created with LiveCycle Designer?
Copy link to clipboard
Copied
I'm trying to create form with acrobat dc not life cycle designer. I was able to create this in life cycle designer. But it doesn't work in acrobat dc.
Copy link to clipboard
Copied
Don't use JavaScript for Designer. Use JavaScript for Acrobat.
Copy link to clipboard
Copied
Javascript is being used for Acrobat DC and it's not working.
Copy link to clipboard
Copied
Did you read the Acrobat JavaScript Reference?
Copy link to clipboard
Copied
Hi.
You can use this JavaScript (not tested) as a calculation script in the textfield2:
var myField = this.getField("textField1");
if (myField.valueAsString == "AAA") {event.target.fillColor = color.red;}
else if (myField.valueAsString == "BBB") {event.target.fillColor = color.blue;}
else if (myField.valueAsString == "CCC") {event.target.fillColor = color.black;}
// etc.
Copy link to clipboard
Copied
Thank you
Find more inspiration, events, and resources on the new Adobe Community
Explore Now