I have the following code and it works great some times but others nothing happens, the button seems to work then for no apparent reason (at least nothing that comes up in the javascript console) I click and it says "FundName.FundTitle.getFundTitle is not a function" but it worked several times before that and nothing changed. Feel like I'm losing my mind, please give me some insight if you have any, everything is set to export for acrobat 9 and I have reader nine installed.
DeedEstablishmentForm.Page1.Button2::click - (JavaScript, client)
var str = FundName.FundTitle.getFundTitle();
I have a fragment that has the following:
form1.FundName.FundTitle::initialize - (JavaScript, client)
function getFundTitle(){
this.str = new String(this.rawValue);
this.start = str.length - 20;
this.idx = str.toLowerCase().lastIndexOf('superannuation fund');
xfa.host.messageBox(this.str.valueOf());
xfa.host.messageBox(this.start.toString());
xfa.host.messageBox(this.idx.toString());
if(this.start >= 1 && this.idx >= this.start && this.idx >= 1){
return this.str.slice(0,idx);
}else{
return this.str;
}
}