# Background color of a textfield in a form

I'm using MikTex and Texmaker to create forms filled by clients. I just want to change the background color of the textfield, how to do it ?

\TextField[bordercolor=, backgroundcolor={red}, strokecolor={black},width=6.5cm,name=MyTextField]{}.


I'm new to Latex and searched many posts, couldn't find the right answer.

What are the name of the properties we can set for a textfield (like width=xxcm, bordercolor=none), could you take me in a right direction please ?

I would ike the backgorund color of my textfield in PDF either transparent or white.

Here is a MWE:

\documentclass[10pt,a4paper]{article}
\usepackage{hyperref}
\usepackage{xcolor}

\begin{document}
\begin{Form}
\TextField[name=Text, width=\linewidth, bordercolor={black}]{}
\end{Form}
\end{document}


TextField before entering anything

TextField after entering something and leaving the field

With $backgroundcolor={white}$ the background color of the field becomes white while the curor is in the field but when clicking somewhere else the color changes back.

The most important part is that you need a Form environment. With it it should work (but there is no strokecolor option:

\documentclass{article}
\usepackage{xcolor}
\usepackage{hyperref}

\begin{document}
\begin{Form}
\TextField[bordercolor=green, backgroundcolor={red},width=6.5cm,name=MyTextField]{}.
\end{Form}
\end{document}


• It doesn't resolve the problem:( Feb 27 '21 at 1:41
– R.U.
Sep 22 '21 at 17:34

Including a minimum working example (MWE) that shows the packages you're working with is always helpful. I assume you're working with the hyperref package based on the \TextField environment.

## Finding LaTeX documentation

To quickly access documentation you can use the texdoc command to access the documdentation for various LaTeX packages (texdoc hyperref) or you can simply google your package name along with CTAN (e.g. hyperref ctan) to quickly find the corresponding package info (usually including docs) on the "CTAN Comprehensive TeX Archive Network"

## What the hyperref docs say

pp. 36-37 of the hyperref PDF docs list all the parameters you can set for forms environments like \TextField.