Here's
what I do. The following goes into the Custom Format
script
event.value = (util.printf("%02d",
event.value));
That code will ensure that no matter what numeric value is entered, there will be two characters, the first of which will be a zero if
only a single digit is entered. If you’d like more than just two characters, change the value of the “2” in the util.printf
argument. For example, if you wanted a phone suffix field with four digits, it would look like this: (util.printf("%04d",
event.value))
That code will ensure that no matter what numeric value is entered, there will be two characters, the first of which will be a zero if
only a single digit is entered. If you’d like more than just two characters, change the value of the “2” in the util.printf
argument. For example, if you wanted a phone suffix field with four digits, it would look like this: (util.printf("%04d",
event.value))
It
would also be helpful to add a "numbers only" script in the Keystroke
script:
if
(event.change.match(/\D+/g)) {
app.beep(0);
event.rc = false;
}
app.beep(0);
event.rc = false;
}
or if
you want numbers only with a possible decimal allowed:
(event.change.match(/[^0-9\.]+/g))
Mark
-----Original Message-----
From: Amy Sachs [mailto:[EMAIL PROTECTED]
Sent: February 3, 2004 9:39 AM
To: [EMAIL PROTECTED]
Subject: [PDF-Forms] Number FormatHello everyone! I have a question that I hope has an easy answer. On a form that I have nearly completed there are a number of fields in which a deposit number is entered. These deposit numbers many times will have the first numeral as a zero. i.e. 0152 or 0231My problem is that Acrobat automatically formats this field once you tab out of it and the 0 disappears. Is there a custom format script I could use or what other options do I have? If anyone could help I would really appreciate it, I need those zeros to stay in place!Thanks in advance,Amy
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
