summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pdf-forms-tutorial-en/forms-src/fde0016.tex
blob: 03b5513585990a8c83f58551d8bc3ac60febcbb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
The choice lists can be initialized using JavaScript instead
of writing the choices in the \textit{\textbackslash{}ChoiceMenu[]\{\}\{\}}
macro.\\
This provides a better overview.

Choices are specified in an array. Each array element is an array again,
consisting of two entries: the full text shown on screen and an
abbreviation:
\begin{lstlisting}
var softwareAuswahl = [
  [ "", ""],
  [ "Betriebssystem", "os" ],
  [ "Textverarbeitung", "tp" ],
  [ "Tabellenkalkulation", "sc" ],
  [ "Präsentationsprogramm", "pp" ],
  [ "E-Mail-Client", "mc" ],
  [ "Web browser", "wb" ],
  [ "Mathematik-Software", "ms" ],
  [ "PDF-Anzeigeprogramm", "pv" ]
];
\end{lstlisting}
The \textit{setItems()\/} method sets the choices for
a choice list:
\begin{lstlisting}
this.getField("sw01").setItems(softwareAuswahl);
\end{lstlisting}
\lstinputlisting{../examples/ex0101.tex}