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

disable open for a pdf if javascript is disabled in Reader

acrobat_student
Registered: Dec 29 2010
Posts: 28
Answered

Hi,
 
Im currently writing some javascript to popualte a form ina pdf and would like to enforce users to enable javascript before opening the pdf, in case they have it disabled. How can I do this?

My Product Information:
Acrobat 8.1.5
UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
It's not possible. You can warn them it's required (that will happen automatically via the yellow Document Message Bar) but all the functions to close a file rely on JavaScript.
maxwyss
Registered: Jul 25 2006
Posts: 255
Accepted Answer
The strategy in such a situation is the other way around. You allow opening the document, but in a way that it is unusable. Then you use JavaScript to make it usable (such as showing contents). So, if your user has JavaScript deactivated or uses a viewer which does not support JavaScript, can not use the document. It is, of course, helpful to let the user know why the document can not be used.

HTH.

Max Wyss.

acrobat_student
Registered: Dec 29 2010
Posts: 28
thanks maxwyss , I just saw the same post by you in the other question. that is indedeed ingenious.
acrobat_student
Registered: Dec 29 2010
Posts: 28
maxwyss, what would be the best (less expensive, easier,quicker) way to go about placing this form control in the pdf - using XFA or Livecycle designed? will the form control have to be placed on each page or can i just place one form control at the pdf level that dosent scroll with the pages but disappears once the user logs in correctly? appreciate the asistance. thanks
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
The inserting and hiding of the form field is very much dependent upon how the form was created.

XFA is the format used by LiveCycle Designer.

With a multiple page form you could to place a the warning form field on all pages and use a form JavaScript object to hide the fields.

If you created the form using Acrobat, you put the warning field with the same field name on all pages and use a document level script to hide that field. It would even be possible to perform this task as an Action in Acrobat X or a batch process in older versions.

George Kaiser

acrobat_student
Registered: Dec 29 2010
Posts: 28
could there be just one form field that covers all the pages that gets disabled by a document level javascript when the user enters a user id/pwd that is authenitcated against a web-service? could there be any other technical hurdles to this approach, since im bit of a novice?

thx