cancel
Showing results for 
Search instead for 
Did you mean: 

Print structrured field using offsets

Former Member
0 Kudos

Hello guys,

I have structured form context field with name FIELD (not a structure!), let's say a ten char field with the value "AAAABBBBCC" and I would like to write separately the first four chars ("AAAA") than the seconds ("BBBB") and last but not least the last two ("CC").

Can you tell me if this is possible in adobe form (e.g. FIELD+4(4) => "BBBB") and how?

Thanks in advance.

Kind Regards,

Alex

Accepted Solutions (0)

Answers (1)

Answers (1)

OttoGold
Active Contributor
0 Kudos

Hello,

if I were you, I would split the parts in the backend and send a structure into the form, it is much more transparent and straightforward. If you insist on doing this manually, I believe you can script this out. I believe there is charAt method.

Regards Otto

p.s.: you can play around with combs

Former Member
0 Kudos

Hi Otto,

Thanks for you quick reply.

And where I would make the call of the charAt method?

I doun't have much experience with scripting. Can you show me an example?

What do you mean with "playing around with combs"?.

Thanks one more time.

KR,

Alex

OttoGold
Active Contributor
0 Kudos

About the combs: Open the LCD, place text field (for example, works for some more field types as well) and on tab Object, Field there is a field "comb of X characters". Write 10 for example and see what happens, you will get the field splitted into characters (useful for formal forms, like for the government, where you write in a single char in a field blah blah, check for yourself). Be careful, this work only in 8.1 LCD, not in 7.1 for example (upgrade for your own good).

Otto

OttoGold
Active Contributor
0 Kudos

About the scripting:

there are PDF guides by Adobe for this scripting, search for them.

Example:

var key = this.field_src.rawValue; //placed on the parent subform of field_A and _B you want to fill

for (i=0;i<key.length;i++) {

if (i == 0) field_A.rawValue = key.charAt(i);

else field_B.rawValue = key.charAt(i);

}

Warning: does not do what you want, only assigns the first char of field_src to _A and last to _B (if longer than 1).

Regards Otto