on 09-21-2010 12:28 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.