default options of ChoiceMenu with hyperref package

Antwort erstellen


Diese Frage dient dazu, das automatisierte Versenden von Formularen durch Spam-Bots zu verhindern.
Smilies
:D :) :( :o :shock: :? 8) :lol: :-x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen:

BBCode ist eingeschaltet
[img] ist eingeschaltet
[flash] ist ausgeschaltet
[url] ist eingeschaltet
Smilies sind eingeschaltet

Die letzten Beiträge des Themas

Ich habe die Datenschutzerklärung gelesen und bin damit einverstanden.

   

Wenn du eine Datei oder mehrere Dateien anhängen möchtest, gib die Details unten ein.

Ansicht erweitern Die letzten Beiträge des Themas: default options of ChoiceMenu with hyperref package

von Johannes_B » Mo 12. Okt 2015, 21:13

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.

default options of ChoiceMenu with hyperref package

von luuuusss » Mo 12. Okt 2015, 20:34

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]

Nach oben