hi,
i have a pdf form made by adobe livecycle designer. here there r 2 fields. say one field A and anothe is B . i want to populate info in field b which will depend on value of A. IF i put 4 in A then B will 17., if A 5 B 21 .... etc. can u pls help to make such tye of code?
thanks
Ali
Solved! Go to Solution.
Views
Replies
Total Likes
Sorry my mistake. Here is the corrected code. you only need this on the first field. I had excluded the .rawValue
if(this.rawValue == "apple"){
fieldB.rawValue = "Orange"
}
else
if(this.rawValue == "water melon"){
fieldB.rawValue = "coconut"
}
Views
Replies
Total Likes
if you have the 2 fields fieldA and fieldB and you want fieldB to get a value from fieldA and add to it you would write something like this on fieldB
this.rawValue = fieldA.rawValue + 9;
Note: this will only work this way if fieldA and fieldB are numerical fields if not use the following
this.rawValue = Number(fieldA.rawValue) + 9;
Views
Replies
Total Likes
hi,
thanks a lot for ur response. here no specific numerical relation. for a specific number it will auto populate anther specific number. but no relation between then. u can think if i put "mango " in A then Banana in B.
thanks
Ali
Views
Replies
Total Likes
ok. then the script you could use would be similar
So if you want this to occur after the first field has a value you would put this on the exit event for the first field.
fieldB.rawValue = "Mango"
What will happen is upon leaving the first field the script will run and populate the second field with Mango
Views
Replies
Total Likes
and also like so on. say apple for orange, bread for biscuit etc. i mean ont only one items. for more than 1 items.
thanks
Ali
Views
Replies
Total Likes
for more clear-
if A = mango
B= banana
,
if A = apple
B= orange
if A = water melon
B= coconut
thanks
Ali
Views
Replies
Total Likes
so this gets a bit more complex but still fairly easy
On the exit event you would write:
if(this.rawValue == "apple"){
fieldB = "Orange"
}
else
if(this.rawValue == "water melon"){
fieldB = "coconut"
}
this is fine for a couple items. You may need to consider another mechanism if you are going to have to manage a more complex list.
Views
Replies
Total Likes
pls see this file. it is not working-
Views
Replies
Total Likes
I cannot get to dropbox due to security on my machine. Please send it to my email at mousland@gmail.com
Views
Replies
Total Likes
Sorry my mistake. Here is the corrected code. you only need this on the first field. I had excluded the .rawValue
if(this.rawValue == "apple"){
fieldB.rawValue = "Orange"
}
else
if(this.rawValue == "water melon"){
fieldB.rawValue = "coconut"
}
Views
Replies
Total Likes
thanks a lot. now working.
Views
Replies
Total Likes
Remember that apple, orange etc are literals so if they are not entered exactly as typed it will not work. You can do this better with a drop-list where a user picks from the list and then gets a result. For example if you wanted a drop down list of fruit for example apple, orange, grapes, etc. When the user picks this the field would have corresponding info in the next field. Maybe color so pick Apple get Red
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies