• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How do I average or hide based on drop down list selection????

New Here ,
Mar 19, 2021 Mar 19, 2021

Copy link to clipboard

Copied

How do I get a field to average if another field’s display is visible and hide it if the display is hidden?  It doesn’t seem like I can have it both ways.  If “Laborer/Sampler” is selected from a drop-down list, “knowledge of product”, “Cooperation”, “Attitude”, “Judgement” and “Tact” are hidden. “Grade” is an average of the afore mentioned fields and is also a “read only” field.  It will not “hide” when “Laborer/Sampler” is selected.  Any help would be greatly appreciated., Thanks!

 

Evaluation_1.jpg

Views

740

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 19, 2021 Mar 19, 2021

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 19, 2021 Mar 19, 2021

Copy link to clipboard

Copied

What kind of form is this?

Are you building it in Dreamweaver, InDesign or something else?

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 22, 2021 Mar 22, 2021

Copy link to clipboard

Copied

I'm just creating a form Adobe DC, trying to use a "Custom Calculation Script" 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2021 Mar 22, 2021

Copy link to clipboard

Copied

Oh, you mean Adobe Acrobat Pro DC.

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2021 Mar 22, 2021

Copy link to clipboard

Copied

As the custom validation script of the Position field you can enter something like this:

this.getField("Grade").display = (event.value=="Laborer/Sampler") ? display.hidden : display.visible;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 23, 2021 Mar 23, 2021

Copy link to clipboard

Copied

I found a script that works perfectly.  Thank you for your help!

var fields = [ "Knowledge of Product", "Cooperation", "Attitude", "Judgement", "Tact" ];

var cnt = 0;
var total = 0;

for (var i in fields) {
var f = this.getField(fields[i]);
if (f.valueAsString != "") {
cnt++;
total = total + Number(f.value);
}
}

event.value = total/cnt;

if (this.getField("Position").value == "Inspector"){

event.target.display = display.visible;
}
else{

event.target.display = display.hidden;

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2021 Mar 22, 2021

Copy link to clipboard

Copied

You'll need to extend the code provided by Try67 to include not only the fields, but also the text.  To do this the text needs to be removed from the PDF and replaced with Read Only Text fields.

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 23, 2021 Mar 23, 2021

Copy link to clipboard

Copied

Thank you for your help, I found a script that works (see above).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2021 Mar 22, 2021

Copy link to clipboard

Copied

If you just want to hide /show fields depending on dropdown selection, use this code as "Validation" script of dropdown field:

if(event.value == "Laborer/Sampler"){
this.getField("knowledge of product").display = display.visible;
this.getField("Cooperation").display = display.visible;
this.getField("Attitude").display = display.visible;
this.getField("Judgement").display = display.visible;
this.getField("Tact").display = display.visible;
this.getField("Grade").display = display.visible;}
else{
this.getField("knowledge of product").display = display.hidden;
this.getField("Cooperation").display = display.hidden;
this.getField("Attitude").display = display.hidden;
this.getField("Judgement").display = display.hidden;
this.getField("Tact").display = display.hidden;
this.getField("Grade").display = display.hidden;}

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 23, 2021 Mar 23, 2021

Copy link to clipboard

Copied

LATEST

Thank you! I found a script that works (see above).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines