Solved

Adobe and Javascript

Posted on 2009-07-01
4
598 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article discusses how to implement server side field validation and display customized error messages to the client.
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

728 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