These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Conditional Formatting in Dynamic Stamp Text Field

Ndallenaz
Registered: Jun 14 2010
Posts: 5

Hello,

I'm trying to make a stamp that will autofill with the user's responses, then apply conditional formatting. I've hit a dead end, though.

I was able to follow the how-to's and make a prompt when the stamp is applied to a document. The user's response shows up correctly. However, the conditional formatting is doing something a little odd.

It is using the previous response to calculate the conditional formatting. So if I answered "YES" the first time, it does nothing. Then by answering "NO" the second time, it erroneously colors it green. Then if I answer "YES" again, it erroneously colors it red. I'm guessing that's due to the fact that the value is saved into the stamp after it's applied to the document.

Is there a workaround for this so I can force it to calculate the conditional formatting between the time that the user provides an answer and the stamp is actually rendered?

Thanks!

My Product Information:
Acrobat Pro 9.3.1, Windows
Ndallenaz
Registered: Jun 14 2010
Posts: 5
PS: This is the code I'm currently using

var cAsk = "Auto Limits Acceptable? YES or NO" ;
var cTitle = "Auto Limits";
if(event.source.forReal && (event.source.stampName == "#AI4EGwWBhUBZb07sYZerWD"))
{
var cMsg = app.response(cAsk, cTitle);
event.value = cMsg;
event.source.source.info.DocumentState = cMsg;
}var q1 = this.getField("Auto Limits")

{
if
(q1.value == "NO")
(q1.textColor = ["RGB",1,0,0]);
else
(q1.textColor = ["RGB",0,0.667,0]);
}
try67
Expert
Registered: Oct 30 2008
Posts: 2399
You need to use curly quotes after the second if-statement.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com