dataroot.Transmittal_pdf.Table6.Row5.Recipient_Name::change - (JavaScript, client)
var rec_list = this.boundItem(xfa.event.newText).slice(0,this.boundItem(xfa.event.newText).insexOf(",")) ------ is this correct to get the string upto "," (comma)
xfa.host.messageBox(rec_list);
This code not working for me. somebody please help me
with regards
prasad
Views
Replies
Total Likes
Hi,
You have a spelling mistake "insexOf" should be "indexOf". Once that is changed it should work.
Hope that helps
Malcolm
Views
Replies
Total Likes
Malcom
ya. thank you. now it is worked fine. i have another problem. i have text field value is 456/D.9.1/08/2011. i want to combine 456 - D.9.1 and i want to pass it to other filelds . thease values are not constant.
var rec_list = dataroot.Transmittal_pdf.txt_ref.rawValue.slice(0,dataroot.Transmittal_pdf.txt_ref.rawValue.indexOf("/")); this line separates 456
but how to get D.9.1 out of the above text. please help me.
Views
Replies
Total Likes
Hi Prasad,
if your D.9.1 always comes after second "/",
then this stmt might help you
var fromIndex = dataroot.Transmittal_pdf.txt_ref.rawValue.indexOf("/"); //returns the first index value after your number 456 i.e., 4.
var rec_list2 = dataroot.Transmittal_pdf.txt_ref.rawValue.slice(fromIndex + 1,dataroot.Transmittal_pdf.txt_ref.rawValue.indexOf("/")); this gives the string between the first "/" and the second one i.e.,D.9.1.
Hope this works good for you.
kc
Views
Replies
Total Likes
kc,
I tried in the same way as you told .but rec_list2 message list not displaying .?.
var fromIndex = dataroot.Transmittal_pdf.txt_ref.rawValue.indexOf("/");
var rec_list2 = dataroot.Transmittal_pdf.txt_ref.rawValue.slice(fromIndex + 1,dataroot.Transmittal_pdf.txt_ref.rawValue.indexOf("/")); // this value display problem?
xfa.host.messageBox(rec_list);
xfa.host.messageBox(rec_list2);
with regards
prasad
var rec_list = dataroot.Transmittal_pdf.txt_ref.rawValue.slice(0,fromIndex);
Views
Replies
Total Likes