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

execDialog question

kerrykew
Registered: Nov 25 2008
Posts: 19
Answered

Hello,
I have a timesheet that collects additional time information from users via an execDialog box. The issue I am facing is that I don't want to have to copy and modify the code for the execDialog box for every day of the week. I know I can put the code in a document level script but the code contains day specific calculations. How can a variable be passed to the execDialog function such that I can set field pointers to the appropriate fields?
Any help is very much appreciated!
Thanks!

My Product Information:
LiveCycle Designer, Windows
kerrykew
Registered: Nov 25 2008
Posts: 19
Accepted Answer
Okay, after carefully reading the execDialog section of the Javascript for Acrobat Reference I discovered the last example listed in the reference answers my original question. Following the JS reference's example I created a function as follows:

function dotheDialog(dialog,doc)
{
dialog.doc = doc;
var retn = app.execDialog(dialog);
}

The function above calls the dialog box function which is stored in a separate script object. The final piece of the puzzle was to execute the above function as follows:
DialogExec.dotheDialog(TimeInput.dialog1, "Sun");
I have this code in a radial box if statement. I get to add the day of the week to the argument which is now a "property of the dialog box". This works perfectly. I figured I would post this in case someone else was looking for a solution to the problem I stated earlier. I am not a trained javascript programmer so this forum and the pdfscripting web site have been life savers!
Thanks!