|
|
| Author |
Message |
chrispegg
 Total Messages 1
|
| Subject: | How do I code this? |
I have 2 fields in my PDF form that I need to conditionally link.
The field "ShirtType" is a drop down with 4 entries:
1) Short Sleeve Tee Shirt
2) Long Sleeve Tee Shirt
3) Crew Neck Sweat Shirt
4) Hooded Sweat Shirt
Based on the selection, the field "CostPerParticipant" should be filled in as follows:
If "ShirtType" = Short Sleeve Tee Shirt then "CostPerParticipant" = 100;
If "ShirtType" = Long Sleeve Tee Shirt then "CostPerParticipant" = 105;
If "ShirtType" = Crew Neck Sweat Shirt then "CostPerParticipant" = 110;
If "ShirtType" = Hooded Sweat Shirt then "CostPerParticipant" = 115
I have tried If-ElseIf statements and Case statements but am having no luck. Any help would be appreciated.
| Posted: 22 Nov 2009 01:10 PM |
|
|
| |
BAlheit
 Total Messages 854
|
| Subject: | How do I code this? |
Which programming language do you use? You may try JavaScript.
| Posted: 22 Nov 2009 09:14 PM |
|
|
| |
gkaiseril
 Total Messages 3000
|
| Subject: | How do I code this? |
Assuming Acrobat JavaScirpt, you need to access a field's object and use the JavaScript syntax for the fields involved.
// custom calculation for field CostPerParticipant
event.value = ''; // clear field
if(this.getField("ShirtType).value = "Short Sleeve Tee Shirt") {
event.value = "100;
}
if(this.getField("ShirtType).value = "Long Sleeve Tee Shirt") {
event.value = "105;
}
if(this.getField("ShirtType).value = "Crew Neck Sweat Shirt") {
event.value = "110;
}
if(this.getField("ShirtType).value = "Hooded Sweat Shirt") {
event.value = "115
}
| Posted: 23 Nov 2009 09:30 AM |
|
|
| |
BAlheit
 Total Messages 854
|
| Subject: | How do I code this? |
For comparison use '==' not '='.
| Posted: 23 Nov 2009 08:09 PM |
|
|
| |
|
|