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

Leading Zero's

BHale
Registered: Mar 4 2009
Posts: 7
Answered

Should be a simple one, right?

I have a form where the user is prompted to enter a 3 digit number. I then take that number and pre-fill it into a 2nd field. When I carry that value I lose any leading zero's.

Any thoughts?

My Product Information:
Acrobat Pro 9.0, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You will have to use the 'util.printf()' method to create text string with the leading zero or use the 'AFNumber_Format()' funciton to set the field's format, [url=http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=482]Setting number format to a text field[/url].

George Kaiser

BHale
Registered: Mar 4 2009
Posts: 7
Thank You!

I was actually able to do it with this script, a little more 'remedial' than yours. But I really appreciate your response.

CopyValues ();

function CopyValues() {

var legalnbr1 = this.getField("LegalIDNbr1#1");
var legalnbr2 = this.getField("LegalIDNbr2#1");
var LN1 = event.value.toString(legalnbr1);
legalnbr2.value = LN1;
}