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

Drop Down Script to text field

MHolt117
Registered: Jun 5 2007
Posts: 4

I am using Adobe Live Cycle designer to build forms and I want to link a drop down box to a text field and I can not figure out how. For Example if a user selects "White" from a drop down and I want that to automatically put "123" in one text field and "234" in another test field how would I script this?? I am very new at this and probably need an answer built for a five year old :-) but I would appreciate any help. Thank You!!

My Product Information:
Acrobat Pro 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Read this article

[url=http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/change_another_field/]http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/change_another_field/[/url]

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

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Sorry, I keep forgetting that the article is about AcroForm Scripting. The concepts are the same so the only thing that isn't valid is the actual code.

In LiveCycle you use a "Change" Event script (same as AcroForms) to capture the latest dropDown change. Note that "xfa.event.change" holds the value of the change.

Here's some code
//... Change Event for Drop Down .. switch(xfa.event.change){case "White":MyOneField.rawValue = "123";MyTwoField.rawValue = "234";break; case "Green":MyOneField.rawValue = "789";MyTwoField.rawValue = "567"; break; }

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