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

Scripting/forms

bluidgr75
Registered: Nov 26 2007
Posts: 3

I need to write a script in a form to make a field required in a previous field had data entered? I am really new to Acrobat and have not done scripting for a LONG time! Thanks for your help!

My Product Information:
Acrobat Pro 8.0999999999999996447286321199499070644378662109375, Windows
lsutton
Expert
Registered: Nov 15 2005
Posts: 51
With JavaScript (in Acrobat) you can retrieve the value of fields by using the getField method:

var v = this.getField("myTextField").value;

Once you have the "value" of the field you can script any number of operations against it.

if(v==""||v==null)
app.alert("Please enter a value!");

Be sure to check out the DevNet site at [url=http://www.adobe.com/devnet]http://www.adobe.com/devnet[/url]. Specifically, search for "Developing Acrobat Applications Using JavaScript" for a complete reference.
bluidgr75
Registered: Nov 26 2007
Posts: 3
I think you might be over simplifying this for me. Can you give me idiots directions as to where I even need to put this info in? The v== thing, if I were wanting it to be required if a certain drop down menu was chosen before it, how could I code that and make it a required field?