I'm trying to run a javascript in WillPrint Document Actions. A for loop is setup to count the text fields on the document, validate the value is not null and then change the border color when condition is true to transparent but nothing is working. The Debugger is setup and I get through errors but It's like something is is not turned on. Can you please help. I can send the script if need be.
Thanks
Deedee
My Product Information:
Acrobat Pro 7 / Windows
Offline

If your script is throwing exceptions then obviously it's not going to work. It probably has nothing to do with the WillPrint event. So yes, please post your code.
Offline
Thanks Thom for your respones. As it turns out, I wasn't event getting in the the for loop in order to validate the text field boxes. It's working now. The script is posted below. Now I'm trying to put the boxes back via the "Clear" button and reset the fields once the form is printed. I thought I could simply use the same code and make the strokeColor my custom RGB, 255,191,170, but when I click the "Clear" button, it's removing more text boxes instead of adding them back to the form. You might be able to tell I'm a newbie at JavaScript, but I'm catching on a little.
WILLPRINT DOCUMENT ACTION script:
for ( var i = 0; i < this.numFields; i++)
{
var fname = this.getNthFieldName(i);
var f = this.getField(fname);
if (!(f.valueAsString == ''))
{
color.transparent = new Array("T")
f.strokeColor = color.transparent
};
};
CLEAR button script
for ( var i = 0; i < this.numFields; i++)
{
var fname = this.getNthFieldName(i);
var f = this.getField(fname);
if (f.valueAsString == " ")
{
colLtPink = new Array("RGB", 255,191,170)
f.strokeColor = colLtPink
};
};
Offline
AcrobatUsers.com >> User Groups • News • Events • Articles • Blogs • How To • Resources • Member Log in