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

Controlling the data written to the XML file from a form

sseliquini
Registered: Jan 23 2008
Posts: 4
Answered

I have a form that I created using LiveCycle Developer 8.0 that has several subforms. I have a set of radio buttons and display a subform based on the result of the radio button chosen.

I have two questions:

1) How do I only save the data in the XML file from the subform that was chosen based on the radio button?

2) When a radio button is chosen, the data saved in the XML file for that button is its rawValue which is a numerical value based on its position in the radio button control. I want to save the value of the associated caption.

My radio buttons are:
1 Application
2 Database
3 Hardware

The value of 1 or 2 or 3 is saved instead of Application, Database or Hardware.

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
First, radio buttons don't really have a numerical value. It's a text string that just happes to be a number. So you can set the export value of the radio button to anthing you want in the binding tab for the radio group.

The data is exported from the LiveCycle form through the field binding and the data model.

A field's binding determines if it exports data, and in what form, and how, that data is exported. So you could enable or disable data export by changing this field property with JavaScript.

The actual exported data is maintained in the Data Model, accessed with "xfa.data". I haven't tried this, but hypothetically you could modify the model with JavaScript.

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

sseliquini
Registered: Jan 23 2008
Posts: 4
Thanks. For some silly reason I didn't try changing the value returned when a radio button is selected. That works great.

I will try changing the binding value to control whether the subform is output to the xml file or not.

I appreciate your help.