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

How to...

Ray
Registered: Mar 6 2007
Posts: 48

This is about a textfield that is a combo of 7 parts. How do I set this textfiled up so that the first character is set to a "P." For example the end result should be something like P123456. The "P" is a fixed character. Thx

My Product Information:
Acrobat Standard 8, Windows
tedpadova
ExpertTeam
Registered: Dec 31 2005
Posts: 848
This question is really tough to answer. What do you mean by a text field with 7 parts? Are you talking about the options for the data entered in the field, a Combo Box with 7 items, or soemthing else?

Do you want the P to appear along with data that are calculated, user supplied, or something else?

I'm going out on a limb and assume you want one of two options. Option 1. a P along with user supplied data. If so, set up an Arbitrary Mask for the text field. In the Format tab of the Text Ffield Properties, slect Custom from the Select format category pull-down menu. Scroll the options and select Arbitrary Mask.

In the text box below the Arbitrary Mask selection, type P999999. The P is a fixed character. The 9's represent any numeric value a user types in the text field. Therefore when the user clicks in the field and types 123456 the result reads P123456.

Option 2. If you want the value calculated, choose None from the Select format category. In your JavaScript you might have a calculation like:

var f = this.getField("first field");
Var g = this.getField("secondField");
event.value = "P" + (f.value + g.value);

Hope this helps.

ted

The author of numerous books on Acrobat, Photoshop, Illustrator and the Adobe Creative Suite, and an international speaker on Adobe Acrobat, Ted Padova is a well-known PDF guru.

Ray
Registered: Mar 6 2007
Posts: 48
Thank you Ted. You are awesome.
Your first assumption is correct. But I cannot see a Format Tab in the LiveCycle Designer 8.0 program to be able to follow your steps in option one of your response. Am I missing something? Is there anyway I can reveal the Format Tab?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Ray,
Ted's answer was for an AcroForm PDF. You need to state up front what forms technology you're using. In Designer (i.e. XFA forms) the methodology is the same, but the details are different. See the answers posted by Carl and me for your other post on this.

Cheers,

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