Home
 
The page you are viewing is part of our 160,000 page PDF discussion forum archive spanning 1999-2011.
Go to the new Planet PDF forum to join the PDF community.
 

Search
 Advanced   
Sign up for a WebBoard account Archive Forum Home


PLATINUM
SPONSOR

GOLD
SPONSORS



Topic  
Go to previous topicPrev TopicGo to next topicNext Topic
Author Message
chrispegg
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
Left Button SpacerView user's profile profileRight Button Spacer
 
 
BAlheit
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
Left Button SpacerView user's profile profileRight Button Spacer
 
 
gkaiseril
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
Left Button SpacerView user's profile profileRight Button Spacer
 
 
BAlheit
BAlheit

Total Messages 854

Subject:How do I code this?

For comparison use '==' not '='.


Posted: 23 Nov 2009 08:09 PM
Left Button SpacerView user's profile profileRight Button Spacer
 
 
   
Go to previous topicPrev TopicGo to next topicNext Topic

go




Top | News | Developer | Find PDF Tools | Sponsorship | Tips | Home



Debenu's Planet PDF - a comprehensive site exclusively focused on Adobe Acrobat/PDF users and uses. Debenu's Planet PDF - Resources for Adobe Acrobat and PDF users

Please post PDF-related questions to our Planet PDF Forum forums.planetpdf.com. To send comments about this site please visit our contact page.
Planet PDF, Planet PDF Forum, PDF SDK - Debenu Quick PDF Library and Debenu are all copyright
© 2011 Debenu Pty Ltd.. All Rights Reserved. Privacy policy.