What is the code I use to make the caption of a text field show the instance count of its parent subform?
Views
Replies
Total Likes
this.parent.index will show you the instance of the subform that you are in.
Paul
So, how do I make it display?
This was my attempt:
xfa.resolveNode("this.caption.value.#text").value = this.parent.index;
Views
Replies
Total Likes
There is nothing wrong with your code....but you are assigning a numeric value to a string value and javascript does not seem to like that. If you modify the right side of the equation to be:
"" + this.parent.index
Then it seems to work.
Paul
Woo hoo! Almost there. I need to add 1 to the index because otherwise it starts at 0.
How do I do that?
Views
Replies
Total Likes
OK, I got it to work. This is what I did:
var number = this.parent.index + 1
xfa.resolveNode("this.caption.value.#text").value = "" + number;
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies