I have been trying for hours to get this to work. I am new to working code on a PDF doc.. and I am sure I am doing something stupid, as I would think this should be a simple task.
I have a form, and I just want to add a javascript to the submit button. (It already is performing a function of creating a pdf of the answers, and eMailing it.)
On the submit button property - action tab - the trigger is 'Mouse UP', and it has the 'Submit a form' action first (to send the eMail). I have then added the action to 'Run a JavaScript'. It then gives me an option of editing the javascript I want to run.
I am used to javascripting in html, but I think this is different in PDF.
Can anyone show me the exact pdf javascript code (to place in the submit button's property box javascript editor) to make a browser window pop-up filled with an html page (http://www.optinest.com/stage/optiuser/2008Conference/PayPal.htm)?
AND if that is possible... can you be so kind to show me the slightly tricker code to check first to see if a specific radio button has been ticked (name="Payment.0", export value="2"), before I open up this pop-up window?
I would greatly appreciate any help, as I need to get this form live this weekend.. and I am failing miserably so far on my own!
Also, can you tell me, if I do get this javascript successfully added to the form, will it function correctly in reader? (I heard there are some accessability issues using javascript in certain reader version.)
Thanks for your help!
http://www.adobe.com/devnet/acrobat/javascript.php
To open up a browser window use this code
app.launchURL("http://.....");
To check for a a radio button use this code:
if( this.getField("Payment").isBoxChecked(0) )
{
...
}
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script