Skip to main content
Known Participant
October 18, 2016
Question

Dropdown javascript to open new document?

  • October 18, 2016
  • 2 replies
  • 357 views

I have a drop down. What I would like to do is, when I select the first item in the drop down list called doc1.pdf, then it would open. If I select the second item in the list called doc2.pdf, then it would open and so on for the rest of the drop down list. Is it possible using a bit of javascript? If you know how the scripting would you please help me accomplish this? Thank you.

This topic has been closed for replies.

2 replies

Inspiring
October 19, 2016

Do you know any JavaScripting?

One could use the document's name and path as the optional value for the drop down and then use that value as the parameter for the "app.openDoc()" method. If you have a "select item" or empty choice item then you need to add some code to not process this item.

http://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_AcroJS%2Fapp_methods.htm%23TOC_openDocbc-28&rhtocid=_6_1_8_6_1_27

Acrobat JavaScript API Reference

https://developer.mozilla.org/en-US/docs/Web/JavaScript

MDN JavaScript Reference

pdfUser1Author
Known Participant
October 19, 2016

Thanks for the links. I will check them more throughly later when I have more time. I briefly read some of the info, but I really don't understand what I'm reading, but I believe if a person keeps reading, it will soon make sense and one starts to understand. I just have one question, these info links, are they for Acrobat Javascript or web?

My level of javascripting was learned from attending the "seat of my pants university" and one book. I would like to take a class in it but don't know where or have the time. I'm pretty good at following working examples, cutting and pasting.