Skip to main content
Participant
January 24, 2025
Question

Formulaire

  • January 24, 2025
  • 3 replies
  • 312 views

Bonjour,

Je voudrais savoir si cela est possible de mettre des champs bleutés dans la préparation d'un formulaire sur des zones de texte (ex. le texte dit quoi inscrire dans le champ) et que ce message disparaisse lorsque la perosnne inscrit sa réponse dans le champ. Pour le moment, le tout ne fait que se superposer et est illisible.

Quelles sont mes options si une telle manoeuvre est possible ?

3 replies

JR Boulay
Community Expert
Community Expert
February 7, 2025

Bonjour

 

Placez les instructions (texte d'aide) dans le champ "valeur par défaut" des Propriétés du champ.

 

Ensuite placez ce script en action "champ activé" :

if (event.target.value == event.target.defaultValue) {
event.target.value = ""; // supprime le texte d'aide
event.target.textColor = color.black; // remet le texte en noir dans le champ
}

 

Et placez ce script en action "champ désactivé :

if (event.target.value == "") { // si le champ est laissé vide (non rempli)
event.target.value = event.target.defaultValue; // replace le texte d'aide
event.target.textColor = color.ltGray; // texte en gris clair
}

 

Ce script utilise un texte d'aide en gris clair et assume que le texte "normal" est en noir mais bien entendu vous pouvez changer ces couleurs comme bon vous semble.

Acrobate du PDF, InDesigner et Photoshopographe
PDF Automation Station
Community Expert
Community Expert
January 24, 2025

Use a custom format script:

if(!event.value)

{

event.value="Instructional Text";

event.target.fillColor=["RGB",0.8,0.84,1];

}

else

{

event.target.fillColor=color.transparent;

}

 

Read more on custom format scripts:

https://pdfautomationstation.substack.com/p/custom-format-for-pdf-fields

https://pdfautomationstation.substack.com/p/more-custom-formatting-for-pdf-fields

 

Legend
January 24, 2025

Hi 

Thank you for reaching out with your question. 
Please read this help page related to Form Field properties: https://adobe.ly/4gexeWC;

Modify the appearance of the form field

In the Appearance tab, you can adjust how the form field is visually presented on the page. This tab is available for all form field types except barcodes and offers the following options:

  • Border Color: Choose a color for the field frame or opt for no frame.
  • Line Thickness: Determine the thickness of the field frame (Thin, Medium, or Thick).
  • Fill Color: Select a background color for the field or keep it transparent.
  • Line Style: Alter the appearance of the frame with options like Solid, Dashed, or Underline.
  • Font Size: Set the size of entered text or selection markers, with an Auto option for dynamic resizing.
  • Text Color: Choose a color for the text or selection marker.
  • Font: Select from available fonts on your system (not applicable for non-text displaying fields).

Let us know if you have further questions.

 


~Tariq