Changing from Acrobat to Livecycle

I use the attached script as a document Javascript called 'SetFieldValues' in Adobe Acrobat. It gets its value from a drop-down box called 'locationdropdown'.

It works great, however we are changing our forms to have flowable content so I have to re-build them with LiveCycle Designer (version 8 if that matters). How and where can I establish this script to work properly in Livecycle. Would it still need to be a document script or do I need to add it to the drop down box scripting somehwere?

I can add files if that would help. Thank you for any assistance!
// Locations Pre-population Data

var DeptData = { Augusta:{  location: "Augusta League of Therapists",
                               address: "336 S. Wayne Ave Waynesboro, Va 22980 ph 540.949.7045 fax 540.949.8897",
                 Charlottesville:{ location: "Charlottesville League of Therapists",
                               address: "911 East Jefferson Street Charlottesville, VA 22901 ph 434.984.0023 fax 434.984.4852",
                 Culpeper :{  location: "Culpeper League of Therapists",
                               address: "120 Sycamore Street Culpeper, VA 22701 ph. 540.829.4006 fax 540.829.0440",
		 Danville :{   location: "Danville League of Therapists",
                               address: "1045 Main St. Suite 4, Danville, VA 24541 ph. 434.791.4131 fax ",
                 Harrisonburg :{   location: "Harrisonburg League of Therapists",
                               address: "312 S. Main St. Harrisonburg, Va 22801 ph. 540.437.1605 fax 540.437.1606",
                 Lynchburg:{  location: "Lynchburg League of Therapists",
                               address: "523 Clay Street Lynchburg, VA 24504 ph.434.455.7990 fax 434.455.0256",
                 "New River":{ location: "New River League of Therapists",
                               address: "7350 Peppers Ferry Blvd Fairlawn, VA 24141 ph.540.633.3816 fax 540.633.3819",
                 "Richmond Area":{  location: "Greater Richmond League of Therapists",
                               address: "10100 Iron Bridge Rd. Suite 102 Richmond, Va 23832 ph.804.778.7443 fax 804.778.7446",
                 Roanoke :{   location: "Roanoke League of Therapists",
                               address: "1420 3rd Street SW Roanoke, VA 24016 ph. 540.343.3577 fax 540.343.3866",
                 "Rockbridge Area" :{   location: "Rockbridge League of Therapists",
                               address: "2424 Magnolia Ave. Buena Vista, VA 24416 ph. 540.264.0100 fax 540.264.0167",
                " Choose Location" :{   location: "Choose Location from drop down",
                               address: " ",


function SetFieldValues(cDeptName)
// Populate fields with values from the Department Data Object
   this.getField("Location").value = DeptData[cDeptName].location;
   this.getField("Address").value = DeptData[cDeptName].address;

Open in new window

Who is Participating?
You can set the default values in the "initialize" evnet of the dropdown list box.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.