Two elements are involved:
Dropdown list called TransactionType - possible values are "A" "B" or "C"
Checkbox chkVerification
I have created the following javascript for the change event of the dropdownbox TransactionType
form1.#subform[0].TransactionType::change - (JavaScript, client)
if(this.rawValue == "A"){chkVerification.caption.value.text.value = "Verification A"}
else if(this.rawValue == "B"){chkVerification.caption.value.text.value = "Verification B";}
When I check the script syntax it comes up without any errors, but when I change the value in the drop down the caption of the checkbox never changes.
What am I missing here?
By using the app.alert function I think I can see that I need to trigger the script as xfa.event.newText but the caption isn't changing.
I've also tried this :
form1.resolveNode("chkVerification.caption.value.#text").value = "Verification A";
Is what I'm trying to do even possible?
Solved! Go to Solution.
Views
Replies
Total Likes
The form has to be saved as a dynamic PDF form to enable dynamic behaviour including caption changes.
Additionally, I find it much easier to explicitly name pages. It is less problematic. So rather than accessing "form1.#subform[0].DropDownList1" you are accessing "form1.page1.DropDownList1".
// form1.page1.DropDownList1::exit - (JavaScript, client)
var char_ = this.rawValue;
xfa.resolveNode("form1.page1.CheckBox1.caption.value.#text").value = char_;
Steve
Views
Replies
Total Likes
1) Did you save the form as a dynamic PDF?
2) Put the script on the exit event rather than the change event and use resolveNode
// form1.page1.dd::exit - (JavaScript, client)
var char_ = this.rawValue;
xfa.resolveNode("form1.page1.cb.caption.value.#text").value = "Verfication " + char_;
Steve
Still not working - again no error messages or complaints from the compiler, the caption simply doesn't change like it is supposed to.
Views
Replies
Total Likes
If you forward the form to stwalker.adobe@gmail.com and I can take a look.
Steve
The form has to be saved as a dynamic PDF form to enable dynamic behaviour including caption changes.
Additionally, I find it much easier to explicitly name pages. It is less problematic. So rather than accessing "form1.#subform[0].DropDownList1" you are accessing "form1.page1.DropDownList1".
// form1.page1.DropDownList1::exit - (JavaScript, client)
var char_ = this.rawValue;
xfa.resolveNode("form1.page1.CheckBox1.caption.value.#text").value = char_;
Steve
Views
Replies
Total Likes
I thought it was saved as a dynamic form... when I was working in another form with other features I saved it the same way and things worked correctly.
Does that mean that I can't use the preview PDF tab in live cycle to test the code?
Views
Replies
Total Likes
No. You have two options:
1) Configure LiveCycle Designer to use dynamic XML form as the default data type, or
2) Save the form as a dynamic PDF before doing preview.
Steve
Views
Replies
Total Likes
Hi Steve,
Its a bit of an old thread already, but I am facing similar problems to what Albert was facing.
My form is already configured to use 1)dynamic XML form as default data type and 2)Preview as Interactive form.
The techinique I am trying to use is also xfa.resolveNode("form1.page1.cb.caption.value.#text").value = "Abc";
However, it doesn't seem to work. On test, no code is ran after that line, which means that element could be invalid, but I've checked and it seemed ok.
Language used is Javascript and not FormCalc too. Any idea how I can tackle this?
Thanks!
Views
Replies
Total Likes
Views
Likes
Replies