Print Page | Close Window

Open PDF Form before running Document Level scrip

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: JavaScript
Forum Description: Discussions relating to the use of JavaScript within PDF.
URL: http://forums.planetpdf.com/forum_posts.asp?TID=2099
Printed Date: 16 Sep 2019 at 5:24pm
Software Version: Web Wiz Forums 11.10 - http://www.webwizforums.com


Topic: Open PDF Form before running Document Level scrip
Posted By: parteegolfer
Subject: Open PDF Form before running Document Level scrip
Date Posted: 13 Dec 2016 at 6:58pm

I have this Code in a document level script. The problem I am encountering is that this question box shows up before the actual form loads. I need to ensure that the form is blank before this pops up and before any other script is run. I cant fiqure this out and can use some help. I have tried the app.setTimeOut function (see second line from the bottom of the code). But no luck. Any suggestions would be appreciated!! I am goin crazy trying to figure this out and I am sure there is a simple answer. 

Document Level Code

function IncreaseReportNumber()
{
var vButton = app.alert({
cMsg: "Do you want to advance the report number?",
cTitle: "A message from Dan Sajdak",   nIcon: 2, nType: 3  });


if ( vButton == 4  )
{
//Increase Report Number
var oField = this.getField("REPORT NUMBER");

if(oField == null) app.alert("Error in field name: REPORT NUMBER\Check spelling and capitalizaton.", 1, 0);
oField.value ++ ;
oField.defaultValue = oField.value ;

}
else
{

// more debugging code;
app.alert("number not updated", 3, 0);

} // end response 4;
return
} // end IncreaseReportNumber function;

//app.setTimeOut("IncreaseReportNumber()",250);

IncreaseReportNumber();

 




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 - http://www.webwizforums.com
Copyright ©2001-2017 Web Wiz Ltd. - https://www.webwiz.net