I have a script for a DDL on exit below. If the value of an item starts with 135, a message show up.
I have the DDL in a repeating instant. Script work for the first instant but not for the second!
What I am doing wrong? CC is the Drpo down list.
Thanks
var strNewtext = form1.Page1.ALL.Item_Sub.All_A.details.detail.CC.rawValue.toString();
if (strNewtext.length>3){
if(strNewtext.substring(0,3)=="135")
xfa.host.messageBox("This is……","CAPITAL ACCOUNT",3);
Solved! Go to Solution.
Views
Replies
Total Likes
You need to reference the instance specifically in order for the script to work on repeating instances.
I'm not sure about the exact layout of your form, subforms and elements, but this script works if "All_A" is the repeating subform (just change the parent.instanceIndex reference to whichever element is the repeating one)
var dropDown = "form1.Page1.ALL.Item_Sub.All_A["+parent.parent.parent.instanceIndex+"].details.detail.CC";
var strNewtext = xfa.resolveNode(dropDown).rawValue;
if (strNewtext.length>3){
if(strNewtext.substring(0,3)=="135") {
xfa.host.messageBox("This is……","CAPITAL ACCOUNT",3);
}
}
Views
Replies
Total Likes
You need to reference the instance specifically in order for the script to work on repeating instances.
I'm not sure about the exact layout of your form, subforms and elements, but this script works if "All_A" is the repeating subform (just change the parent.instanceIndex reference to whichever element is the repeating one)
var dropDown = "form1.Page1.ALL.Item_Sub.All_A["+parent.parent.parent.instanceIndex+"].details.detail.CC";
var strNewtext = xfa.resolveNode(dropDown).rawValue;
if (strNewtext.length>3){
if(strNewtext.substring(0,3)=="135") {
xfa.host.messageBox("This is……","CAPITAL ACCOUNT",3);
}
}
Views
Replies
Total Likes
Thank you!
Views
Replies
Total Likes
You're welcome :)
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies