These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Hard Coded Prefix Addition to a Generated Number

vargs
Registered: Jul 2 2010
Posts: 26
Answered

Hello,

I was wondering if it was possible to add a string of hard coded text that goes before a generated number in a text field in LiveCycle.

I have a generated number such as 1280520227 and i wanted to have that number generate with a fixed string as the following: "Order Form- 1280520227"

The code for the Number is:
******************

if (this.rawValue == null)
{
var d = new Date();
//divide by 1000 to get seconds and trim decimals
this.rawValue = Math.floor(d / 1000);
}
else
{
this.rawValue = rawValue;
}

******************

I hope this was a good enough explanation, if anything else if unclear, please feel free to let me know.
I am running LiveCycle Designer ES 8.2
Thanks,

-vargs

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Yes,

you only need to change your script a little bit.
this.rawValue = "Order Form - " + Math.floor(d / 1000);

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

vargs
Registered: Jul 2 2010
Posts: 26
thank you so much,

It worked perfectly

-vargs