I have the code on a checkbox object in the mouseup event:
Outline is this:
form1
mainForm
subForm
checkBox1
I plan on having many more subForms.
This is the script:
if (this.rawValue == 1 || xfa.resolveNodes("mainForm.subForm[*]").checkBox1.rawValue ==1)
xfa.resolveNodes("form1.mainForm.subForm[*]").border.fill.color.value = "180,180,180";
else
xfa.resolveNodes("form1.mainForm.subForm[*]").border.fill.color.value = "255,255,255";
When I click on this checkbox the mainForm background should turn gray. Instead, it does nothing. Anybody have any idea why this script does not work?
Thanks for any help!
Solved! Go to Solution.
Views
Replies
Total Likes
The resolveNodes method returns more than one object.If you want to set a field value in an instance, then you need to use resolveNode method.
But when you resolveNode method, you need to pass the index of the subForm. You can not pass [*]..
Probably based on your heirarchy, your code might need to look like this..
var intIndex = this.parent.index;
if (this.rawValue == 1 || xfa.resolveNode("mainForm.subForm["+ intIndex +"]").checkBox1.rawValue ==1)
xfa.resolveNode("form1.mainForm.subForm["+ intIndex +"]").border.fill.color.value = "180,180,180";
else
xfa.resolveNode("form1.mainForm.subForm["+ intIndex +"]").border.fill.color.value = "255,255,255";
Thanks
Srini
Views
Replies
Total Likes
The resolveNodes method returns more than one object.If you want to set a field value in an instance, then you need to use resolveNode method.
But when you resolveNode method, you need to pass the index of the subForm. You can not pass [*]..
Probably based on your heirarchy, your code might need to look like this..
var intIndex = this.parent.index;
if (this.rawValue == 1 || xfa.resolveNode("mainForm.subForm["+ intIndex +"]").checkBox1.rawValue ==1)
xfa.resolveNode("form1.mainForm.subForm["+ intIndex +"]").border.fill.color.value = "180,180,180";
else
xfa.resolveNode("form1.mainForm.subForm["+ intIndex +"]").border.fill.color.value = "255,255,255";
Thanks
Srini
Views
Replies
Total Likes
YES!!!! That did the trick!!! Thank you Srini!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies