Expand my Community achievements bar.

Make text field readonly

Avatar

Former Community Member
Hi,



I have many text fields in my document. When the document opens my script asks for a password. Depending on which password was typed in, I will enable and disable certain text fields. How do I make fields "readonly" using the javascript in Adobe LiveCycle Designer 7.0? I have tried things like:



this.Page1.txtField.lock = true;

this.Page1.txtField.readOnly = true;



but with no success. I can still type in the field. Any help will be appreciated.



PS: Am very new to PDF scripting.
7 Replies

Avatar

Former Community Member
Hi Nilesh,



In order to make a field readOnly using Javascript you can try the following code:

TextField1.access = "readOnly";

On the other hand, in order to make it open:

TextField1.access = "open";



http://partners.adobe.com/public/developer/en/xml/Adobe_XML_Form_Object_Model_Reference.pdf

Page Number : 313



Regards,

Nassia

Avatar

Former Community Member
Nassia,



thanks a lot mate. That does complete my problem and now I can complete my project.

Avatar

Former Community Member
Hi, I have a follow-up on Nilesh's original question. I am setting a state variable in a hidden form field. This form is LiveCycle Workflow enabled, so as it progresses through the workflow, I set the state accordingly. On the form:ready event for the 'state' form field, I test the state value. Depending upon the value, I set text field, dropdown list field access (either readOnly or open) per the examples above. The problem is, that these sets do not have any affect on the editability of the fields when it is rendered (using pdf preview).



Is the form:ready event the correct event to set editability on other fields in the form? It appears that the sets on the Object-Value palette/tab are the ones that are setting the editability.

Avatar

Former Community Member
Hello,



I'm looking for a way to program to make all the fields of a PDF file readonly after fill in data using ASP or PHP - to prevent a user from downloading a blank PDF form.



Any tips?



Thanks,



Dean

Avatar

Former Community Member
Maybe, if you have to make a data submit you can use the event preSubmit in order to change the state of all the fields to read only or the event post-execute, but in the latter case you have to work directly in the XML Source tab.



Bye,

Aldo

Avatar

Former Community Member
I have a similar question...



I have an input form (HTML) that will display data from our database. The data is to be used to fill in a W-9. Since our shop is a JAVA shop, I'll be displaying the data using Struts/HTML. The data will be validated when the form is submitted.



After the form is submitted, I'd like to take a PDF that has form fields in it, and populate them via an import. I've been able to do this via XPAAJ. I'd like to render this back to the user, BUT I'd like the form fields to now be read-only. What must I do to import the form data into the PDF and render it back to the user as a readonly document?



Thanks for any help.

Avatar

Former Community Member
hi nilesh,



please can you let help how to ask passwored when open pdf form