Hi,
Here is a script on change event to change the caption of the repeating field:
form1.Page1.personalInfo.
Default caption is: Manager
My problem it is that works only for the first instant.
Does not work for the second, third and so on...instances
Any help
Thank you very much
switch (xfa.event.newText)
{
case "A":
xfa.resolveNode("form1.Page1.personalInfo.caption.value.#text").value = "Manager";
break;
case "B":
xfa.resolveNode("form1.Page1.personalInfo.caption.value.#text").value= "Director";
break;
case "C":
xfa.resolveNode("form1.Page1.personalInfo.caption.value.#text").value= "Manager";
break;
}
Views
Replies
Total Likes
Hi mmgiath,
form1.Page1.personalInfo.caption.value.#text will always refer to the first instance.
We need to first identify where you have added the code.
1) If the code is added on the field which is a part of the repeating instance, you can just use the script:
switch(xfa.event.newText)
{
case "A":
xfa.resolveNode("this.caption.value.#text").value = "Manager";
break;
case "B":
xfa.resolveNode("this.caption.value.#text").value= "Director";
break;
case "C":
xfa.resolveNode("this.caption.value.#text").value= "Manager";
break;
}
Views
Replies
Total Likes
Hi mmgiath,
Try with the code of kvdvijaykumar on event or index:change and change xfa.event.newText by this.rawValue.
Hope this helps.
Views
Replies
Total Likes
There is a change for my original question, I apologize..:
In a repeating subform I have a text field with a caption: Manager
This which I like to achive is any time I click the button to insert a new instant
the caption to change to Director.
Is this possible?
Thanks again for your help
Views
Replies
Total Likes
I have try this script below, without ANY LUCK!
Works for the first instant but all the next ones they have the default caption (Manager)
Any HELP?
xfa.resolveNode("form1.Page1.personalInfo.All.CostCentre_B.caption.value.#text").value = "Director”;
Views
Replies
Total Likes
Hi mmgiath,
I guess the problem lies in indexing of the repeated subform. If you set the index of the repeated subform right. Then it will work.
Lets say the repeating subform's name is personalInfo. You have to change the caption of CostCentre_B which is not repeating. Try the following.
var i = this.parent.index ;(choose accrodingly for your repeating subform).
var currentPersonalInfo = xfa.resolveNode(("form1.Page1.personalInfo[" + i + "]);
// some mode code as per your requirement.
currentPersonalInfo.CostCentre_B.caption.val ue.#text").value = "As sou wish”;
Hope this helps.
Thanks,
Bibhu.
Views
Replies
Total Likes
Hi Bibhu, thank you for your reply,
Costcentre_B is a repeating field inside the repeating subform PersonalInfo.
I try your script but does not work. Any idea what I am diing wrong?
Thank you
Views
Replies
Total Likes
Hi mmgiath,
could you mail me your form @ kvdvijaykumar@gmail.com ?
Views
Replies
Total Likes
Do you want to say that both subforms and fields are getting repeated?
Views
Replies
Total Likes
Yes, both are repeating.
Thanks
Views
Replies
Total Likes
Hi ,
The below script would help you. Keep the script on click of the button.
Subfrm1.instanceManager.addInstance(1);
var countInst = Subfrm1.instanceManager.count;
var countAct = countInst - 1;
xfa.resolveNode("Subfrm1["+countAct +"].TextField1.caption.value.#text").value = "Director"
Below link will be for your reference...
https://workspaces.acrobat.com/?d=kChABCf5oRpsk7fyR7P-vg
If you want to repeat the captions like Manager, Director, Manager, Director can be done by doing very minor modifications in the script.
Thanks
Vjay.
Views
Replies
Total Likes
Perfect!
THANK YOU SO MUCH!!!
Views
Replies
Total Likes