Solved

Acrobat Forms - Populate field based on Combo Box selection

Posted on 2016-10-13
7
57 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article focuses on how to remove password security from multiple PDF files by Adobe Acrobat program. Sometimes it is essential to access the stored data items and to print, edit as well as copy content from Portable Document Format files in abs…
*Adobe Acrobat 9 was used for this article.  Particular steps may vary depending on software versions. Adobe Acrobat has many, many variables that my be utilized to customize your forms for clarity and ease of use. The Form Editing Tool will be y…
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

689 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