8 Answers

Voted Best Answer

The most common approach is to create a field that provides a message about the need for JavaScript and make this field large enough to cover the form. By default this field will be visible and printable. You then can create a document level script which will run when the form is opened and it will hide the field. You could start with all form fields hidden and have the script make the fields visible, but this could cause a delay that could become lengthy depending upon the number of fields.

No, you can't prevent someone from opening a PDF file.What you can do, however, is include a warning message of some kind in the file, and the use JS to hide it. So if JS is disabled, the user will see the warning message. You can also use the same method to hide some (or all) of the contents of the page.

Gilad D - Thanks for the quick reply. What I am trying to accomplish is to hide content of a document unless a javascript runs that connect to our database and retrieves some information. I don't want the user to see any content if the javascript cannot run.

Where is your database in relation to the user? A live cycle form will only help if you can control the users system, because it requires the DB driver to be on the users system. This is particularly difficult if the DB is remote.

There is however, a way to connect any PDF to a remote DB. What you do is put the DB on a server, and then write a server script to transfer info in and out of the DB using one of the PDF data formats. Then all the PDF needs to do is to perform submitForm opertions to the script.