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

Hide drop down box when printing only when "PLEASE SELECT" is chosen (unused field).

Community Beginner ,
Apr 14, 2016 Apr 14, 2016

Our form has numerous dropdown boxes that default to the option "Please Select", and not all of them are used each time the form is used.  When we print a hard copy of each document, we would like the "Please Select" (unused) field to disappear when printing - to make a cleaner hard copy.  Is there a script for this?  I tried using the General Setting "Visible but doesn't print" but of course, the field doesn't print at all - we need it to print only when there has been an option other than the default "Please Select" is selected.  Thank you in advance for your help.

Coleen

TOPICS
Acrobat SDK and JavaScript , Windows
4.7K
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

correct answers 1 Correct answer

LEGEND , Apr 14, 2016 Apr 14, 2016

You can use a custom Validate script, something like:

event.target.display = event.value === "Please Select" ? display.noPrint : display.visible;

For this to take effect, you will need to make a different selection and then set it back to "Please Select". ANother option would be to place it as a custom Format script.

Translate
LEGEND ,
Apr 14, 2016 Apr 14, 2016

You can use a custom Validate script, something like:

event.target.display = event.value === "Please Select" ? display.noPrint : display.visible;

For this to take effect, you will need to make a different selection and then set it back to "Please Select". ANother option would be to place it as a custom Format script.

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 Beginner ,
Apr 14, 2016 Apr 14, 2016

George, I tried this script in both the Custom Validate and Custom Format (separately) and tried printing after making the two selections in the field, the second being "Please Select".  When I printed the page, the field still printed. I don't think we want to make two selections on each blank field before we print, so it is likely not worth your time to troubleshoot this.

Thanks,

Coleen

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
LEGEND ,
Apr 14, 2016 Apr 14, 2016

You only have to make the two selections just after adding the script. After that, it will work. Validate scripts are triggered when the field value changes, so for you to see the effect initially after adding the script, you have to change the field value.

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 Beginner ,
Apr 15, 2016 Apr 15, 2016
LATEST

Got it!  Thank you very much!!  I had to change the code from Please Select to PLEASE SELECT and then it worked perfectly for me. Thanks again.

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