# Settings for hypertext in multiline environment

I am writing this question after seeing this one as I had no idea that you could make forms like that in TeX.

Playing a bit with the code in that example I came across two issues I could not find how to change with the \TextField[parameters]{label}environment.

How to set the number of lines in a multiline environment and how to move the label at the top rather than the bottom of the multiline box.

According to the manual the option for the multiline environment is just a boolean parameter

multiline boolean false whether text box is multiline

and the label appears at the bottom rather than the top.

-

1. To specify the height of a multiline text fielf, use the optional argument height, such as

\TextField[multiline=true,height=6\baselineskip,...]{Comments}\\

2. For vertical alignment, you could use \height which gives he height of a box, together with \raisebox, such as

\renewcommand*{\LayoutTextField}[2]{\makebox[6em][l]{#1: }%
\raisebox{\baselineskip}{\raisebox{-\height}{#2}}}

3. You could even adjust the default height of a multiline text field, like

\renewcommand*{\DefaultHeightofTextMultiline}{6\baselineskip}


Here's a complete example for this, re-using the code of the linked question:

\documentclass{article}
\usepackage{hyperref}
\renewcommand*{\DefaultHeightofTextMultiline}{6\baselineskip}
\renewcommand*{\LayoutTextField}[2]{\makebox[6em][l]{#1: }%
\raisebox{\baselineskip}{\raisebox{-\height}{#2}}}
%\renewcommand*{\LayoutTextField}[2]{% or this or similar ...
%\raisebox{-\height}{\makebox[6em][l]{#1: }}\raisebox{-\height}{#2}}
\def\LayoutChoiceField#1#2{\makebox[6em][l]{#1: }#2}
\newdimen\longline
\begin{document}
\begin{Form}
\TextField[name=Name,width=\longline,borderwidth=0,bordersep=4pt,
backgroundcolor={.85 .85 .85}]{Name}\vskip1ex

\TextField[name=Affiliation,width=\longline,borderwidth=0,
backgroundcolor={.85 .85 .85},]{Affiliation}\vskip1ex