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

fixed character

Ray
Registered: Mar 6 2007
Posts: 48

Hi,
This is for LiveCycle Designer 8. I have a text field configured as a "comb 7," seven characters. I have to set it up so that the first letter shows as a fixed letter "P" and the remainng six characters would be the values entered by the user. It would appear like this: P123456
 
I could not find a way to do it in the LiveCycle Designer. Thank you

My Product Information:
Acrobat Standard 8, Windows
pdftrainer
Expert
Registered: Dec 14 2005
Posts: 180
Interesting question. One approach would be to make the caption and the P field one unit, and the P read only. Then position a captionless 6 character field to the right of the P.

A certified expert on Adobe Acrobat, Carl Young is an Adobe Acrobat and LiveCycle Designer trainer and consultant based in Phoenix. He is the producer of the [link=http://www.pdfconference.com/]PDF Conference[/link].

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Unfortunately you can't use the picture clause on this one. That's the string that entered into the Display field on Designer's Object tab.

Here's a "Change" event script that will do it.

if(xfa.event.fullText == "")xfa.event.change = 'P';else if(!( /^P\d{0,6}$/.test(xfa.event.fullText) )){xfa.event.selEnd = xfa.event.selStart;xfa.event.change = "";}
Make the field a Text Field, NOT a Number field. Set it's default value to "P" and then enter this script into the JavaScript "Change" Event for the field.

Let me know how this works for you.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script