Solved

Adobe and Javascript

Posted on 2009-07-01
4
588 Views
Last Modified: 2012-05-07

I have the attached codes inside of the adobe pdf, and it work fine except when the button is clicked, the parent page will be redirected to url that the code is pointing to...
instead of that, I prefer to have just show a popup ("Done"), and clear all the data inside of the form. Have anyone known the coding javascript in Adobe Acrobat?

var typeofbond  = this.getField("typeofbond");
var bondamount  = this.getField("bondamount");
var exedate       = this.getField("exedate");
var term          = this.getField("term");
var priname       = this.getField("priname");
var phone       = this.getField("phone");
var pfax       = this.getField("pfax");
var pstreet       = this.getField("pstreet");
var pcity       = this.getField("pcity");
var pstate      = this.getField("pstate");
var pzip       = this.getField("pzip");
 
 
this.submitForm("https://xxx/eservices/testpdf.asp?typeofbond=" + typeofbond.value + "&bondamount=" + bondamount.value + "&priname=" + priname.value + "&pstreet=" + pstreet.value + "&pcity=" + pcity.value + "&pstate=" + pstate.value + "&pzip=" + pzip.value + "&phone=" + phone.value + "&pfax=" + pfax.value);
 
0
Comment
Question by:Webboy2008
  • 2
4 Comments
 
LVL 15

Expert Comment

by:mohan_sekar
ID: 24757716
To reset the form, use this.resetForm(); to show an alert use, app.alert('Done');
0
 

Author Comment

by:Webboy2008
ID: 24765016
mohan_sekar: thank you, however, because of using app.alert('xxx')
it shows a "x" icon on  the left. can message box show another icon or not icon is fine.
do we have app.message('xxx') thing like that?
0
 
LVL 15

Accepted Solution

by:
mohan_sekar earned 500 total points
ID: 24765134
It's highly customizable.
Just use app.alert('Done',3)
Here is the complete syntax
 
Parameters

cMsg
A string containing the message to be displayed.

nIcon
(optional) An icon type. Possible values are these:
0: Error (default)
1: Warning
2: Question
3: Status
NOTE:On Macintosh, there is no distinction between warnings and questions.

nType
(optional) A button group type. Possible values are these:
0: OK (default)
1: OK, Cancel
2: Yes, No
3: Yes, No, Cancel

cTitle
(optional, Acrobat 6.0) The dialog box title. If not specified, the title "Adobe Acrobat" is used.

oDoc
(optional, Acrobat 6.0) The Document Object that the alert should be associated with.

oCheckbox
(optional, Acrobat 6.0) If specified, a check box is created in the lower left region of the alert box. oCheckbox is a generic JavaScript object that has three properties. The first two property values are passed to the alert method; the third property returns a Boolean.
ÏcMsg (optional): A string to display with the check box. If not specified, the default string is "Do not show this message again".
ÏbInitialValue (optional): If true, the initial state of the check box is checked. The default is false.
ÏbAfterValue : When the alert method exits, contains the state of the check box when the dialog box is closed.  
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This article shows how to convert a multi-page PDF file into multiple image files, with one image file created for each page of the PDF. It does this by utilizing an excellent, free software package called GraphicsMagick. The solution is amazingly s…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The goal of the tutorial is to teach the user how to import photos into Adobe Lightroom efficiently and to keep everything organized.
Not only does Prezi allow you to create non-linear presentations, it also makes it easy to apply transition animations between your frames. Learn how to apply a fade-in transition to select items and entire frames in this tutorial Select "Edit Path"…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now