views:

48

answers:

1
+1  Q: 

Javascript in PDFs

Thanks in advance.

I am currently creating a PDF document which has fields on it which I'd like to post into an aspx page. Now this bit I have working successfully using a button with the added behaviour 'Submit Form'. I want to tweak this so before the form is submitted a confirmation message pops up, clicking no will abort the for submit, clicking yes will submit the form.

I figure I need to do this in javascript so I've been digging around and come up with the following;

var answer = app.alert("Are you ready to submit this form now?", 2, 2, "Confirmation");
if(answer!=4) 
  this.submitForm("http://localhost:8018/quote/apply.aspx");

I think my submitForm function is rubbish.

Any ideas?

Many thanks, this is baking my noodle!

+1  A: 

Found it, I was being dense. The answer was staring me right in the face.

The first IF block doesn't have the 'THEN' keyword.

Somehow this got past the syntax checker.

The answer is;

var answer = app.alert("Are you ready to submit this form now?", 2, 2, "Confirmation");
if(answer==4) 
this.submitForm("http://localhost:8018/quote/apply.aspx");
Mike Mengell
Wow I feel sheepish... I guess I shouldn't have edited the code as I posted it...
Mike Mengell