default options of ChoiceMenu with hyperref package

Schriftbild, Absätze und Auflistungen einstellen


luuuusss
Forum-Newbie
Forum-Newbie
Beiträge: 1
Registriert: Mo 12. Okt 2015, 20:26

default options of ChoiceMenu with hyperref package

Beitrag von luuuusss »

Hi, i'm creating a form with the hiperref package and have a problem with defining default options for choice menus. It worked out perfectly for TextFields, but not for ChoiceMenu. Can somebody give me an advice how to set global options for ChoiceMenu please?
\documentclass{article}
\usepackage{xcolor}
\usepackage[
pdftex, colorlinks=true,
pdftitle={Mustervertrag Gastaufenthalt}, pdfauthor={Servicezentrum Forschung},
pdfpagemode=UseNone, pdfstartview=FitH,
pagebackref, pdfhighlight={/N}
]{hyperref}
\usepackage[pdftex]{insdljs}
\begin{insDLJS}{gendJS}{gender switch}
function GenderSwitch(myField){var choicefields = ['smain','u1','u2']; var src = this.getField(myField); if(src.value == 'f'){i = 1;} else{i = 0;} for(j = 0; j < choicefields.length ; j++){var f = this.getField(choicefields[j]);f.currentValueIndices = [i];} }
\end{insDLJS}
\begin{document}

\begin{Form}
\renewcommand*{\DefaultOptionsofText}{print, combo, bordercolor={green},
                borderstyle=U, height=0.9em, width=\linewidth,  
                borderwidth=0, donotscroll=true, multiline=true}

\TextField[name={inst} format={var f = this.getField('inst');f.textFont = 'Verdana';}, default={\unexpanded{}}]{}

\ChoiceMenu[menulength=1,bordercolor={white}, width=6cm, combo, name={smain}, default=f,format={var f = this.getField('smain');f.textFont = 'Verdana';},onblur={
GenderSwitch('smain');
}, borderwidth=0]{}{{Gastwissenschaftler} = m, {Gastwissenschaftlerin} = f}

\ChoiceMenu[menulength=1,bordercolor={white}, combo, name={u1}, height =0.9em, default=f,format={var f = this.getField('u1');f.textFont = 'Verdana';},onblur={
GenderSwitch('u1');
}, borderwidth=0]{}{{Der Unternehmer} = m, {Die Unternehmerin} = f}

\end{Form}
\end{document}
[/code]

Benutzeravatar
Johannes_B
Moderator
Moderator
Beiträge: 5079
Registriert: Do 1. Nov 2012, 14:55
Kontaktdaten:

Beitrag von Johannes_B »

Loking at the example, i would say you are able to speak german. It would have been very nice if you would have marked your crosspost and translated the question to the spoken (written) language in this community.
TeXwelt - Fragen und Antworten Schaut vorbei und stellt Fragen.
LaTeX-Vorlagen?

Der Weg zum Ziel: Ruhe bewahren und durchatmen, Beiträge und unterstützende Links aufmerksam lesen, Lösungsansätze verstehen und ggf. nachfragen.

Antworten