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

Pooluate other text feilds from 1 of 3 text fields

slang75
Registered: Apr 22 2009
Posts: 15

Hi all,

I have a PDF form created in acrobat and I have 3 text fields called F1, F2, F3, and what I need is that if only one of the feilds can have text entered and then that value popluate other fileds all called "code" on my form.

So if a user enters '234' in F1, F2 and F3 are blank the other fields called code will say '234'
if a user enters '345' in F2, F1 and F3 remain blank the other fileds named code will say '345'.

F1 '234'
F2
F3

Code '234'
Code '234'
COde '234'

or

F1
F2 '345'
F3

Code '345'
Code '345'
Code '345'

I know about naming fields the same name to duplicate the entry, (thats why code is the same foe many fields) if I name all F1, F2 and F3 the same name, if a user enters '232' in F1, F2 and F3 have that value which I don't want. A user has to enter data in 1 of the 3 fields then that feild value populate other fields called 'code'.

Can anyone help?

Thanks!

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Since the user can only enter text into one field at a time you should add a Validation script to each of the F1, F2, and F3 fields that, when data is entered into the field it sets the other two to ReadOnly. But if the field is cleared, then the script makes the other two fields editable.

As for the code field. Use a calculation script that concatonates the values from all 3 of the input fields. Since 2 of them are always blank there's no problem with extra data getting into the field.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script