Solved

Acrobat Forms - Populate field based on Combo Box selection

Posted on 2016-10-13
7
45 Views
Last Modified: 2016-10-17
I have a pdf form. I have a combo box named "CB1" which has below items as a drop down

Two Wheeler
Four Wheeler (Non AC)
Four Wheeler (AC)
Public Transport / Auto

I want that when some one selects these above items from the combo box a field "Rate" should be automatically populated by value
5
7
9
On Actual

So for e.g if someone selects Two Wheeler as a option, the Rate field should be automatically 5 and so on. I tried the below custom calculation script in the "Rate"  field but it is not working. Can anyone help. I have made sure that Commit Immediately option is selected in the Combo Box field.

My script is as below....

var selectedTYPE = this.getField("CB1").value;
if (selectedTYPE=="Two Wheeler") event.value = "5";
else if (selectedTYPE=="Four Wheeler(Non AC)") event.value = "7";
else if (selectedTYPE=="Four Wheeler(AC)") event.value = "9";
else if (selectedTYPE=="Public Transport / Auto") event.value = "On Actual";
else event.value = "";
0
Comment
Question by:Advait Kawthalkar
  • 4
  • 2
7 Comments
 
LVL 30

Accepted Solution

by:
captain earned 500 total points
ID: 41841907
You could use export values. This will make it easiest.

Populate your list in the dropdown values and select the appropriate export value e.g Two Wheeler has "5" in the Export value.

Keep the 'Commit...immediately' ticked

Then use the Custom Calculation Script on your target field 'Rate'
event.value = getField("CB1").value;

That way you can later add new values to your dropdown without having to code new scripts in the target field.

hope that helps
capt.
0
 

Author Comment

by:Advait Kawthalkar
ID: 41846103
Thanks Captain. Will test this and revert back soon.
0
 

Author Comment

by:Advait Kawthalkar
ID: 41846105
IT worked. Thank you Captain.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:Advait Kawthalkar
ID: 41846107
I am sorry but missed on points. If possible would like to give points to Captain.
0
 

Author Comment

by:Advait Kawthalkar
ID: 41846121
I have one more challenge. The drop down value Public Transport does not have a export value. But I need to calculate Amount. For rest of the drop downs since it has export value I can calculate Rate x Kms = Amount in the "Amount " field. But how to manage when someone selects Public Transport as option?
We need a script like if public transport is selected, one can manually edit the Amount field.
0
 
LVL 30

Expert Comment

by:captain
ID: 41846236
If the solution worked you should accept my answer as the solution, not your own. For the additional question you should open a separate thread so you can attract additional experts.

Capt.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Getting information about Fonts being used in a PDF file A colleague of mine recently faced an issue related to the PDF file format. The PDFs were containing mission critical client information, they were successfully mailed but there was a sm…
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe INTRODUCTION This article presents a solution to a question (http://www.experts-exchange.com/Programming/Installation/Q_28396542.html)…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now