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

Hide/unhide field based on password in a text field

Participant ,
Dec 02, 2021 Dec 02, 2021

Hi, I'm sure this is probably a really easy one, but I'm a newbie to javascript...

What I'd like to achieve is to unhide a hidden field on an Acrobat form based on the correct password being entered into a text field.  Any (polite!) suggestions?

Many thanks in anticipation. 

TOPICS
How to , JavaScript , PDF forms
1.3K
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 ,
Dec 02, 2021 Dec 02, 2021

Place this script as a Validation script in the password field:

 

if (event.value == "PASSWORD") {this.getField("FIELDNAME").display = display.visible;}
else {this.getField("FIELDNAME").display = display.hidden;}


Acrobate du PDF, InDesigner et Photoshopographe

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 ,
Dec 02, 2021 Dec 02, 2021

Place this script as a Validation script in the password field:

 

if (event.value == "PASSWORD") {this.getField("FIELDNAME").display = display.visible;}
else {this.getField("FIELDNAME").display = display.hidden;}


Acrobate du PDF, InDesigner et Photoshopographe
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
Participant ,
Dec 02, 2021 Dec 02, 2021
LATEST

Thank you JR Boulay for the quick response and that worked perfectly.

 

Simple when you know how... not so if you're a JS newbie! Very much appreciated.

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