I'm not sure if the is the right place to post my question I've posted it under forms <http://forums.adobe.com/thread/996327> with no success hoping that someone might be able to help me here:
I have the same question as this thread <http://forums.adobe.com/thread/756410> plus a little bit extra.
So the answer (which has worked out wonderfully) was submitted by George:
// Custom format script for text field
if (!event.value) {
event.value = event.target.userName;
event.target.display = display.noPrint;
} else {
event.target.display = display.visible;
}
But as George eluded in his first post in the thread was:
The problem with this approach is it precludes easily using any of the built-in formats that you may want to use (Number, ZIP code, etc.). You still can, but it requires more scripting.
So how can I get the combination of the Form Field Lable being displayed and also the auto formatting for Phone numbers, Zip Codes etc.?
Any help is greatly appreciated.
I'm running Acrobat X Pro on Windows if that matters.
Message was edited by: chad Snelson
Updated question:
So I was thinking about it some more and remembered seeing this line of code:
event.value = util.printx("99-9999999", event.value); From <http://forum.planetpdf.com/wb/default.asp?action=9&fid=34&read=43365>.
And then the Arbitrary Mask formatting option
<http://help.adobe.com/en_US/acrobat/standard/using/WS58a04a822e3e50102bd615109794195ff-7de 4.w.html>
and it appears that the tax id line of code uses those same guide lines. So is there away to use George's section of code and combine it with the tax id line of code and just use the Arbitrary Mask formatting rules so if one text field was for a zip use George's section and just change the tax id line so instead of all the nines it would just have 99999 ? If this makes any sense or is possible if someone could please reply with an example I'd greatly appreciate it!
So I was playing around with combining both soultions and just added the Tax ID formatting to George's part and came up with this:
// Custom format script for text field
if (!event.value) {
event.value = event.target.userName;
event.target.display = display.noPrint;
} else {
event.target.display = display.visible;
event.value = util.printx("99-9999999", event.value)
}
So that works great if you put in a total of nine numeric characters but if you input letters then it still lets you it just doesn't show them verses the arbitrary mask formatting option where it doesn't even let you put in letters and requires the right about of numeric characters.
So my new question/problem is how to only allow numeric characters to be entered and require the right ammount of characters with the above code?