Adobe LiveCycle - Javascript - Initialize event is looping when I try to update a variable
Hi,
I am struggling to manipulate an address field to remove the country code, format lines breaks and add the country name.
The text I am using is in the format: "First Line / Second Line / Third Line / IE"
var vAddress;
vAddress = addresstest.rawValue ;
vAddress = vAddress.substring(0,vAddress.length-3) ;
vAddress = vAddress.replace(/ \/ /g, "\n");
addresstest.rawValue = vAddress+"\n"+masterHeader.masterHeaderLeft.country.rawValue ;
Output is :
"First Line
Second Line
Third Line /
Irel"
I think the issue is with the final line but when I tested appending text on each line,

the output was:
"First Line
Second Line
Third Line
IE lin line 2 line 3 lin line 2 line 3"
So there is some kind of loop being created.
I have also tried:
addresstest.rawValue = addresstest.rawValue+"\n"+masterHeader.masterHeaderLeft.country.rawValue ;
Which then adds the country line twice so the issue isn't isolated to it being a variable.
Does anyone have any ideas?
Thanks
