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

Hide/showing a text field depending on conditions

New Here ,
Jan 10, 2024 Jan 10, 2024

Hi,

My question is in two parts. I need to show the field ''eligible_Reguliere'' only if the value of the field ''Total'' is equal or bigger than 45. I tried to run scripts on the field ''eligible_Reguliere''. It doesn't work. I tried putting it in the main Javascript of the document. Doesn't work. My script is:

 

var totalField = this.getField("Total");

var eligibleField = this.getField("eligible_Reguliere");

if (totalField.value >= 45) { eligibleField.display = display.visible; }

else { eligibleField.display = display.hidden; }

 

My second part is that I have the field ''eligible_Rapide'' that must show if the box named ''10+'' is checked. How can I do it? 

Every research I do bring me back to this page: Définition des conditions d’affichage et de masquage des champs de formulaires (adobe.com)

But I NEVER those options in Acrobat. Help please!

TOPICS
JavaScript , PDF , PDF forms
1.8K
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
Jan 10, 2024 Jan 10, 2024

For first question, use this script in "Total" field under 'Validate' tab:

var eligibleField = this.getField("eligible_Reguliere");
eligibleField.display = (Number(event.value) >= 45) ? 0:1;

For second question, use this script in ''eligible_Rapide'' field under 'Calculate' tab as 'Custom calculation script':

var box = this.getField("10+").valueAsString;
event.target.display = box === "Off" ? 1:0;

 

View solution in original post

Translate
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 ,
Jan 10, 2024 Jan 10, 2024

For first question, use this script in "Total" field under 'Validate' tab:

var eligibleField = this.getField("eligible_Reguliere");
eligibleField.display = (Number(event.value) >= 45) ? 0:1;

For second question, use this script in ''eligible_Rapide'' field under 'Calculate' tab as 'Custom calculation script':

var box = this.getField("10+").valueAsString;
event.target.display = box === "Off" ? 1:0;

 

Translate
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 ,
Jan 10, 2024 Jan 10, 2024

Awesome, thanks! It almost 100% works

I still have an issue here because My total value is calculated with the sum of values ''DVL 838'' ''DVL 839'' ''DVL 840'' Diplome 1e cycle'' ''Diplome 2e cycle'' ''Year 1 Waterloo'' ''Year 2 Waterloo'' ''value_Formation 1'' ''value_Formation 2'' ''value_Formation 3'' ''value_Congres 1'' ''value_Congres 2'' and ''value_Congres 3'' so I can't put a personnalised script here and do my sum

Translate
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 ,
Jan 10, 2024 Jan 10, 2024

For 'Total' field use it under 'Validate' tab not 'Calculate'.

Translate
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 13, 2024 Mar 13, 2024

Hello,

I'm currently working on the fillable form in Adobe Acrobat Sign and I need your assistance on this. What conditions should I need to use to the following?

I have four text fields that are shown by default, and then Text Field 3 and Text Field 4 should be hidden when any value is entered in Text Field 1 or Text Field 2 (vice versa). Thank you.

 

JB36051591tm0j_0-1710337336693.png

 

Translate
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 13, 2024 Mar 13, 2024

As custom calculation script of any text field, use this:

var t1 = this.getField("Text Field 1");
var t2 = this.getField("Text Field 2");
var t3 = this.getField("Text Field 3");
var t4 = this.getField("Text Field 4");

t1.display = (t3.value!=""||t4.value!="") ? display.hidden : display.visible;
t2.display = (t3.value!=""||t4.value!="") ? display.hidden : display.visible;
t3.display = (t1.value!=""||t2.value!="") ? display.hidden : display.visible;
t4.display = (t1.value!=""||t2.value!="") ? display.hidden : display.visible;
Translate
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 13, 2024 Mar 13, 2024

Thank you, Nesa. 

Where I can put those calculation script? Sorry I'm newbie here in Adobe Acrobat Sign. 

 

JB36051591tm0j_0-1710341075165.png

 

Translate
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
Enthusiast ,
Mar 13, 2024 Mar 13, 2024
LATEST

Use Acrobat to add script, or you can ask on Adobe Sign forum.

Translate
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