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

Populating text fields with data from previously filled data fields.

azamora
Registered: Mar 18 2009
Posts: 13
Answered

I am new at livecycle designer stuff and i am trying to populate some fields based on a checkbox.
Here is what I want to do. I have a form with "ordered by" fields "Same as Above" checkbox and "Delivered To" fields. If the "Same As Above" box is checked, I want all the fields in the "delivered to" area to be populated with the data that was entered in the "Ordered by" fields.

Any help is greatly appreciated.

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You can use a field in continuous text.

Set your text fields "Ordered by" to global binding.
Create a static text field for "Delivered to" an fill it with some spaces.
Mark some spaces and select "text in continuous text" from the context menü (right click).
Designer will create a hidden text field.
Rename this text field to "Ordered by".
So if you type in something it "Ordered by" the static text field will show the same entries.

Now you can mark some other spaces in the static text field and repeat the method for some other global fields of the form.

Example for a static text field filled with entries of other form fields:
[Product]_with amount_[Amount]_was ordered by_[Ordered by]_on_[DateField].

Software ABC V1.0 with amount 1 was ordered by Somebody on Sat 3.21.09.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

azamora
Registered: Mar 18 2009
Posts: 13
Thanks for Responding radzmar.

I do not want to automatically populate the "delivered To" fields all the time. I only want to have them filled when the "Same As Above" box is checked. Sometimes the Ordered by company mailing address and the Delivered To mailing addresses are not the same. I have the following script and it runs with no errors but the information on the "Deliver To" area does not populate with the "Ordered By" information when I click on the "Same As Above" check box. If the box is not checked then they can fill in the delivered to mailing address.

----- form1.TitleRequestForm.#area[1].PAAddress_1::calculate: - (FormCalc, client) -----------------

if (AddressCheckBox.rawValue eq 1) then
PAAddress_1.rawValue eq Address_1.rawValue
else
PAAddress_1.rawValue eq ""
endif

There is always a "0" in my delivered to field. It doen't do anything whether I check or uncheck the box.

I hope you can help me. I've been at it for 4 days.
Thanks in Advance
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
I think you would do better if you first hide the static text field I described and only change its presence with your "Same As Above" check box.
As long the check box is not marked, you can show a blank text field, that you fill out manual.

It's more handy as combining several field entires by a script.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

azamora
Registered: Mar 18 2009
Posts: 13
Thanks. I'll try that.
I crated a text field and added some spaces in the default value under the Value tab on the Object tab.
I then selected the spaces but I do not have the "text in continuous text" option available in the context menu. I am using Adobe liveCycle designer 8.0.
I really appreciate all your help. Please Advice?
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Oh sorry, I'm using a german version of LCD and tried to translate it into english.
Maybe it's called something like flow text, I don't know exactly.

And don't use a text field for user input.
Use a text (blue icon with T+) for this method.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

azamora
Registered: Mar 18 2009
Posts: 13
That's okay. I appreciate you helping me out.
I created the text field, blank out the text, entered spaces, selected the spaces and when i right click, i get the following options:
----------------------------
Cut
Copy
----------------------------
Font
Paragraph
----------------------------
floating Field
Current Page Number
Number of pages
Current Date/Time
Viewer Locale
Viewer Name
Viewer Version
Current Sheet Number
Number of Sheets
----------------------------
Select All
----------------------------

I must be doing wrong here or my version does not have that option.
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
"Floating Field" is what I mean! Sorry, just a translation problem!

Select it, it will create the hidden text field.
Rename this field to "OrderedBy" and set its binding in the object tab to "global".
So you now have to fields with the same name and a global binding.

If you now type in something into the text field "OrderedBy" the static text box will be populated automatically with the same entries.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

azamora
Registered: Mar 18 2009
Posts: 13
No problem. Thanks
Anyway I finally got my script to work. I forgot I had to specify the instance[]. In case anyone is interested in the future here is the code that I used. Make sure the binding is set to normal not global.

if (AddressCheckBox.rawValue eq 0) then
Address_1[1].rawValue = "" Address_2[1].rawValue = "" City[1].rawValue = "" State[1].rawValue = "" ZipCode[1].rawValue = ""
else
(AddressCheckBox.rawValue eq 1) then Address_1[1].rawValue = Address_1[0].rawValue Address_2[1].rawValue = Address_2[0].rawValue City[1].rawValue = City[0].rawValue State[1].rawValue = State[0].rawValue ZipCode[1].rawValue = ZipCode[0].rawValue
endif