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

red field go to black fiel in print mode

Community Beginner ,
Dec 27, 2021 Dec 27, 2021

Hello,

I allow myself to ask for more advice because the last time I had a great response very quickly.

I want to make a form, with fields circled in red to indicate that they must be completed.
But in the impression I would like these fields to be black and not red ?
Do you have any idea how to do this because after some research I did not find anything.
thanks in advance

TOPICS
PDF forms
758
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
2 ACCEPTED SOLUTIONS
Community Beginner ,
Dec 28, 2021 Dec 28, 2021

Hello,

 

Thank you very much for your answer !

 

I have found another solution with javascript.

in the "format" tab of the text field, I added a personalized category with the following code :

var Myvar = this.getField("Nom_Adresse")
if ( Myvar.value == "")
Myvar.strokeColor = color.red; 
else
Myvar.strokeColor = color.transparent;

 

Like that if the field is empty the border is red in printing and at screen, and if the field is not blank the border become transparent at screen and printing

otherwise I had thought to add à text field empty with border red above the text field, and the propriety of the fiel at not printable. like this, I can see a red border at screen and it not printable

 

Thk,

Jérémy

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

Create form fields with a black stroke and make them "Required".

So they will appear with a red stroke which is not printable (as the blue highlight).

That's all.


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

The red border for required fields is a user preference--and shouldn't really be changed on your end. (Technically, it could be disabled via JavaScript but that is not a good policy. I haven't tested it recently in newer versions.)

image.png

Also, I believe it only applies for electronic submission such as when using the Submit button. Users printing the form won't be affected by the required fields. 

 

You should label the fields as required other ways, for example putting an asterisk in the field name and/or in the tool tip. Here is some info:

https://digitalaccessibility.uoregon.edu/guidelines/pdfforms

Lots more info via googling. 

 

If the form does not have to be accessible, you can simply color code them yourself and not use the required setting. 

David Creamer: Community Expert (ACI and ACE 1995-2023)
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 ,
Dec 28, 2021 Dec 28, 2021

Hello,

 

Thank you very much for your answer !

 

I have found another solution with javascript.

in the "format" tab of the text field, I added a personalized category with the following code :

var Myvar = this.getField("Nom_Adresse")
if ( Myvar.value == "")
Myvar.strokeColor = color.red; 
else
Myvar.strokeColor = color.transparent;

 

Like that if the field is empty the border is red in printing and at screen, and if the field is not blank the border become transparent at screen and printing

otherwise I had thought to add à text field empty with border red above the text field, and the propriety of the fiel at not printable. like this, I can see a red border at screen and it not printable

 

Thk,

Jérémy

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 04, 2022 Jan 04, 2022
LATEST

Your script should be used as a Validation script, not Format.

You can simplify this script and thus reuse it identically in all the fields concerned:


if (event.value == "")
event.target.strokeColor = color.red;
else
event.target.strokeColor = color.transparent;


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
Community Expert ,
Dec 28, 2021 Dec 28, 2021

Create form fields with a black stroke and make them "Required".

So they will appear with a red stroke which is not printable (as the blue highlight).

That's all.


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