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

Survey PDF that Populates Answers for User

ChrisReihe
Registered: Dec 21 2009
Posts: 10
Answered

I am trying to do a quick 7 page survey that has one "Yes/No" question and a "Next" button on each page. At the end of the survey I would like the Survey Participant to see the answers they have chosen.

Does anyone have an idea of how to populate this data using ONLY a PDF form? Any help/advice would be great! Thanks in advance!

My Product Information:
Acrobat Pro 8.0
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes, but this kind of custom functionality requires scripting.

One way to do it would be to place a multiline text field on the last page. Then use a calculation script on the text field to count the check boxes and generate a custom message based on the answers.

Have you already created the form?

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

ChrisReihe
Registered: Dec 21 2009
Posts: 10
Thanks for the quick reply!
I have not created the form yet, as it will be quite simple ( a question with a checkbox Yes/No answer, and then a Next button to go to the next page ) 7 page "slideshow" format. Nothing fancy.

I know how to do that part, just have no idea of how to populate the Yes/No answers on the final page, to inform the user of their answers.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
How exactly do you want the data summarized on the last page? What should it look like?

This is not a difficult task, but it will require some simple scripting. Do you have this ability? or do you know of anyone who can help you out?

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

ChrisReihe
Registered: Dec 21 2009
Posts: 10
It will be a summary of their answers:
"According to the answers provided, you will need to complete Steps 4, 5, 7 and 8. "

Pretty simple. I do have web html/scripting experience, so I think I can handle some simple scripting (i believe this will be javascript?).

Anything similar to this you know of I can reference, or ideas of what the script will be? A starting point would be very helpful!
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes, JavaScript is the Acrobat scripting language, so you are in good shape. I think the first thing you need to do is to learn a little bit about the PDF form technologies. There are two of them. A lot has been written about the differences. Here's a link to my blog entry on the topic.
http://www.acrobatusers.com/blogs/thomp/so-what-difference-between-acroforms-and-xfa

Once you figure out which forms technology to use you'll need to learn something about the scripting model for that technology. There's lots of info on this site. And I have some free videos that give an intro to AcroForm PDFs at pdfscripting.com:
http://www.pdfscripting.com/public/34.cfm#FirstForm

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

ChrisReihe
Registered: Dec 21 2009
Posts: 10
Do I need Livecycle Designer to apply this to my PDF forms? I am working on a Mac... I believe Livecycle Designer is only for PC...

Do you have a recommendation on which PDF Form Technology to use? Which one would be the simplest to execute this task?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Oh, that would have been good to know. Don't worry about LiveCycle, you don't need it. Make an ordinary AcroForm. Watch the video on "Making your first PDF form". It covers the details.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

ChrisReihe
Registered: Dec 21 2009
Posts: 10
Is there any way you could tell me what the javascript code would be I place on the submit button at the end of the questionaire that will populate the answers?

To summarize, I have 7 pages total, each with a yes/no radio button which the user will select, they will then select the next button to go to the next page. The last page will have the "submit" button which will summarize their answers. Pretty simple - but all I can find is how to email the data, etc, when all I want to do is have it pop up a new window.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
What does the submit button have to do with it? Do you mean that you want code on the submit that will check all the answers and validate that survey is filled out properly? Or do you just want a text listing of all the answers on the last page?

All I can do is point you in a direction. I can only provide specific code for simple and well defined issues. If you need more general help and/or training, then you should consider hireing a form developer/consultant.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script