1 person found this helpful
I can address the checkbox issue right now. The drop-down list is little more complicated because you have to manipulate the data bindings.
Imagine I have a checkbox called "form1.page1.subform1.cb1" containing the default bindings where 'On' is 1 and 'Off' is 0. For a text field called "form1.page1.subform1.updateCb1" I can add the following exit event script to update the "On" binding. The "On" binding is the first occurrence of the items node thus the reference to "cb1.items".
xfa.resolveNode("form1.page1.subform1.cb1.items.#text").value = this.rawValue;
I managed to do what I needed and thought I might share.
may not be the correct or best way - but it works for me.
Bit of Background
I have three pages in my form from which the results of the first two pages are posted on the last with pricing indication.
I decided to use the rawValue of a checkbox as the price so i can simply do a calculated numerical value on the last page of checkbox1.rawValue + checkbox2.rawValue etc etc
The simple soution I came up with was to use a final button on the last page to process the data and use the following code
if (CheckBox1.rawValue == "1") then
CheckBox1.rawValue = Admin.Pricetable.Row1.Cell4.rawValue
CheckBox1.rawValue = "0"
The above basically means the form will look for the on value and if it is on then will assign a raw value of the price table to the on value when the button is clicked.
You can do the same for a dropdown
if (DropDownList1.rawValue == "2") then
DropDownList1.rawValue = Admin.Pricetable.Row1.Cell4.rawValue
DropDownList1.rawValue = "0"
Hope this helps.
Like I said it may not be the correct or best way but it works!