1 #LyX 2.1 created this file. For more info see http://www.lyx.org/
7 % to be able to use custom colors
8 \usepackage[svgnames,rgb]{xcolor}
10 % ------------------------------------
11 % used to check for needed LaTeX packages
14 % check for package insdljs
15 % used for JavScript code
17 \IfFileExists{insdljs.sty}
18 {\usepackage[pdftex]{insdljs}
19 \setboolean{insdljs}{true}}
20 {\setboolean{insdljs}{false}}
22 \pdfcatalog{/AA \the\pdflastobj\space 0 R}
23 \begin{insDLJS}[exaaae]{exaaae}{JavaScript}
24 function validateTime(){
26 if((event.value == "u") || (event.value == "unlimited")) {
27 this.getField("from").display = display.hidden;
28 this.getField("to").display = display.hidden;
30 this.getField("from").display = display.visible;
31 this.getField("to").display = display.visible;
32 this.getField("from").setFocus();
42 % set fonts for nicer pdf view
43 \IfFileExists{lmodern.sty}
44 {\usepackage{lmodern}}{}
46 \fi % end if pdflatex is used
48 \options BCOR8mm,pagesize
49 \use_default_options false
53 \maintain_unincluded_children false
55 \language_package default
60 \font_typewriter default
62 \font_default_family default
63 \use_non_tex_fonts false
69 \default_output_format default
71 \bibtex_command bibtex
72 \index_command default
76 \pdf_title "Description of the module pdfcomment"
77 \pdf_author "Uwe Stöhr"
78 \pdf_subject "PDF form"
79 \pdf_keywords "LyX, PDF forms, hyperref"
81 \pdf_bookmarksnumbered true
82 \pdf_bookmarksopen true
83 \pdf_bookmarksopenlevel 2
88 \pdf_pdfusetitle false
89 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue, pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false, urlbordercolor={1 0 0}"
92 \use_package amsmath 1
93 \use_package amssymb 1
96 \use_package mathdots 1
97 \use_package mathtools 1
99 \use_package stackrel 0
100 \use_package stmaryrd 0
101 \use_package undertilde 0
103 \cite_engine_type default
107 \paperorientation portrait
111 \notefontcolor #0000ff
118 \paragraph_separation skip
120 \quotes_language english
123 \paperpagestyle default
124 \tracking_changes false
125 \output_changes false
128 \html_be_strict false
133 \begin_layout Begin PDF Form
134 \begin_inset Argument 1
137 \begin_layout Plain Layout
138 action=mailto:forms@lyx.test?subject=The submitted PDF form, method=post
147 Description of the module PDF Form
154 \begin_layout Standard
155 \begin_inset Note Note
158 \begin_layout Plain Layout
159 To export all parts of this document to PDF the LaTeX-package
164 If it is not installed you can export the document anyway but the example
165 in the section about dynamic form fields won't appear in the output.
173 \begin_layout Standard
174 By loading the module PDF
178 Form the whole document or a part of it can be made a PDF form.
179 You can add all possible form elements like text fields buttons etc.
180 This document describes how this is done.
183 \begin_layout Section
185 \begin_inset CommandInset label
187 name "sec:Preparation"
194 \begin_layout Standard
195 At first load the module PDF
199 Form in the document settings of your file.
200 To make the whole document a form, insert the environment
212 from LyX's dropdown menu at the beginning of the document.
213 If only a part of the document should be a form, add
225 at the position where the form should start.
228 \begin_layout Standard
229 \begin_inset Note Greyedout
232 \begin_layout Plain Layout
237 It is only possible to have one form in a PDF file!
245 \begin_layout Standard
246 If the form data should be submitted to a server or the like, then you must
247 specify the URL to where it should be submitted as parameter of the
260 This is done by using the menu
262 Insert\SpecialChar \menuseparator
274 For example in this document the following was inserted to the parameter
278 \begin_layout Standard
281 action=mailto:forms@lyx.test?subject=The submitted PDF form,
282 \begin_inset Newline newline
288 \begin_layout Standard
289 This sends the form data as email to
295 \begin_inset Quotes eld
298 The submitted PDF form
299 \begin_inset Quotes erd
302 and the HTML method is
307 (The other possible method would be
314 \begin_layout Standard
315 \begin_inset Newpage newpage
321 \begin_layout Section
325 \begin_layout Standard
330 possible types of fields in a PDF form:
333 \begin_layout Subsection
337 \begin_layout Standard
338 A text field is added by inserting the custom inset
344 Insert\SpecialChar \menuseparator
352 Write inside the inset the label for the text field that will be printed
353 in the PDF output before the field.
355 \begin_inset Newline newline
359 \begin_inset Flex TextField
362 \begin_layout Plain Layout
364 \begin_inset Argument 1
367 \begin_layout Plain Layout
373 Enter your name here:
381 \begin_layout Standard
382 You must also specify a field name for text fields: Set the cursor into
383 the inset and use the menu
385 Insert\SpecialChar \menuseparator
397 There insert for example the parameter
406 Only if your text field has a label and no parameters the specification
407 of the name can be omitted.
410 \begin_layout Standard
411 All form fields can be customized by adding a parameter inset to them.
412 To do this, set the cursor into the field inset and use the menu
414 Insert\SpecialChar \menuseparator
428 \begin_layout Standard
429 \begin_inset Note Greyedout
432 \begin_layout Plain Layout
437 All braces and brackets in form parameters must be inserted as TeX code!
445 \begin_layout Standard
446 Here is a customized multiline text field with a width of 5
447 \begin_inset space \thinspace{}
450 cm and a proposed content:
451 \begin_inset VSpace defskip
455 \begin_inset Newline newline
459 \begin_inset Flex TextField
462 \begin_layout Plain Layout
464 \begin_inset Argument 1
467 \begin_layout Plain Layout
468 name=customer2, width=5cm, multiline, width=0.6
470 textwidth, height=3cm, value={Testman}
475 Enter your name here:
483 \begin_layout Standard
484 \begin_inset Note Greyedout
487 \begin_layout Plain Layout
492 It is highly recommended to use a uniform layout of all fields in your
495 \begin_inset space \thinspace{}
499 \begin_inset CommandInset ref
501 reference "sec:Form-field-customization"
505 for how this is done.
513 \begin_layout Subsection
517 \begin_layout Standard
518 A check box is added by inserting the custom inset
523 Write inside the inset the label for the box.
525 \begin_inset Newline newline
529 \begin_inset Flex CheckBox
532 \begin_layout Plain Layout
534 \begin_inset Argument 1
537 \begin_layout Plain Layout
543 Are you older than 18 years?
551 \begin_layout Standard
552 You must also specify a field name for check boxes: Set the cursor into
553 the inset and use the menu
555 Insert\SpecialChar \menuseparator
567 There insert for example the parameter
576 Only if your check box has a label and no parameters the specification
577 of the name can be omitted.
580 \begin_layout Subsection
584 \begin_layout Standard
585 A choice menu is added by inserting the custom inset
590 The label is inserted into the
595 The choices are inserted to the inset as comma-separated list.
603 \begin_layout Description
604 Radio Only one choice can be selected
607 \begin_layout Description
608 Combo The choices are listed in a combo box (dropdown list) but the user
609 is allowed to choose something that is not in the predefined list.
612 \begin_layout Description
613 Popdown All choices are listed below each other.
614 It the filed is not high enough a scroll bar is automatically added to
618 \begin_layout Standard
619 To determine the choice menu type, set the cursor into the inset and use
622 Insert\SpecialChar \menuseparator
634 There insert the parameter
649 \begin_layout Standard
650 Here is an example for the radio type:
651 \begin_inset Newline newline
655 \begin_inset Flex ChoiceMenu
658 \begin_layout Plain Layout
660 \begin_inset Argument 1
663 \begin_layout Plain Layout
670 \begin_inset Argument 2
673 \begin_layout Plain Layout
687 \begin_layout Standard
688 Here is an example for the combo type:
689 \begin_inset Newline newline
693 \begin_inset Flex ChoiceMenu
696 \begin_layout Plain Layout
698 \begin_inset Argument 1
701 \begin_layout Plain Layout
707 Albania=Al, Armenia=Ar, Azerbaidschan=Az
708 \begin_inset Argument 2
711 \begin_layout Plain Layout
725 \begin_layout Standard
726 Here is an example for the popdown type:
727 \begin_inset Newline newline
731 \begin_inset Flex ChoiceMenu
734 \begin_layout Plain Layout
736 \begin_inset Argument 1
739 \begin_layout Plain Layout
740 popdown, name=country
745 Albania=Al, Armenia=Ar, Azerbaidschan=Az
746 \begin_inset Argument 2
749 \begin_layout Plain Layout
763 \begin_layout Standard
764 \begin_inset Note Greyedout
767 \begin_layout Plain Layout
772 For the popdown type you must always specify a field name: Add to the
784 for example the parameter
800 \begin_layout Standard
801 It is recommended to add a short name for every choice to be able to access
802 them and to know which one was chosen by the user- This is done by adding
807 behind each choice (where
812 For example the radio type example contains this choice list:
818 \begin_inset Quotes eld
822 \begin_inset Quotes erd
825 you know that he chose the choice
826 \begin_inset Quotes eld
830 \begin_inset Quotes erd
834 By specifying names you can also preset/propose e.g.
835 \begin_inset space \space{}
839 \begin_inset Quotes eld
843 \begin_inset Quotes erd
846 by adding the parameter
854 \begin_layout Standard
855 \begin_inset Flex ChoiceMenu
858 \begin_layout Plain Layout
860 \begin_inset Argument 1
863 \begin_layout Plain Layout
864 radio, name=sex, default=m
870 \begin_inset Argument 2
873 \begin_layout Plain Layout
887 \begin_layout Standard
888 \begin_inset Note Greyedout
891 \begin_layout Plain Layout
896 Due to a bug in the LaTeX package
900 it is currently only possible the set the first choice as default.
908 \begin_layout Subsection
912 \begin_layout Standard
913 A push button is added by inserting the custom inset
918 Write inside the inset the label for the button.
920 \begin_inset Newline newline
924 \begin_inset Flex PushButton
927 \begin_layout Plain Layout
929 Don't click on this button or your fridge will be destroyed!!!
937 \begin_layout Standard
938 The action that is triggered by pressing the button is specified by JavaScript
940 To specify it, set the cursor into the inset and use the menu
942 Insert\SpecialChar \menuseparator
954 There insert the parameter
958 and write the JavaScript code between the braces.
961 \begin_layout Standard
962 \begin_inset Flex PushButton
965 \begin_layout Plain Layout
967 \begin_inset Argument 1
970 \begin_layout Plain Layout
971 onclick={app.alert("What the hell? Now you destroyed your fridge.
977 Don't click on this button or your fridge will be destroyed!!!
985 \begin_layout Standard
986 For info about JavaScript, see its documentation,
987 \begin_inset CommandInset citation
996 \begin_layout Standard
997 A common usage for pus buttons is to open a weblink.
998 Such a button is created by inserting the command
1004 into the button inset.
1011 is used in the scheme
1012 \begin_inset Newline newline
1019 href{link target}{text}
1022 \begin_layout Standard
1023 In the following button this code was used:
1024 \begin_inset Newline newline
1031 href{http://wiki.lyx.org}{Information how to fill out this form}
1034 \begin_layout Standard
1035 \begin_inset Flex PushButton
1038 \begin_layout Plain Layout
1042 href{http://wiki.lyx.org}{Information how to fill out this form}
1050 \begin_layout Standard
1051 To get rid of the frame for weblinks add this to the additional options
1052 in the document settings under
1055 \begin_inset space ~
1063 \begin_layout Standard
1066 urlbordercolor={1 0 0}
1069 \begin_layout Standard
1070 if your push button border color is red (the default), otherwise use the
1071 same color definition as for your push button border color.
1074 \begin_layout Subsection
1078 \begin_layout Standard
1079 A submit button is used to submit the form data to a server.
1080 It is added by inserting the custom inset
1085 Write inside the inset the label for the button.
1087 \begin_inset Newline newline
1091 \begin_inset Flex SubmitButton
1094 \begin_layout Plain Layout
1096 \begin_inset Argument 1
1099 \begin_layout Plain Layout
1105 Send your data via email
1113 \begin_layout Standard
1114 \begin_inset Note Greyedout
1117 \begin_layout Plain Layout
1122 You can only use a submit button if you specified the submit method and
1123 target in the PDF form environment options! See sec.
1124 \begin_inset space \thinspace{}
1128 \begin_inset CommandInset ref
1130 reference "sec:Preparation"
1134 for the description.
1135 If there are no specifications you will get LaTeX errors!
1143 \begin_layout Standard
1144 \begin_inset Note Greyedout
1147 \begin_layout Plain Layout
1152 If you have more than one submit button in your document you must specify
1153 a name for each of them to avoid LaTeX errors! For example write
1161 is the button name).
1169 \begin_layout Subsection
1173 \begin_layout Standard
1174 A reset button is used to reset all form fields to the initial state.
1175 It is added by inserting the custom inset
1180 Write inside the inset the label for the button.
1182 \begin_inset Newline newline
1186 \begin_inset Flex ResetButton
1189 \begin_layout Plain Layout
1191 \begin_inset Argument 1
1194 \begin_layout Plain Layout
1208 \begin_layout Standard
1209 \begin_inset Note Greyedout
1212 \begin_layout Plain Layout
1217 If you have more than one reset button in your document you must specify
1218 a name for each of them to avoid LaTeX errors! For example write
1226 is the button name).
1234 \begin_layout Section
1235 Form field customization
1236 \begin_inset CommandInset label
1238 name "sec:Form-field-customization"
1245 \begin_layout Standard
1246 Since all form elements should look uniform, one can determine their layout
1247 using the following styles:
1250 \begin_layout Description
1252 \begin_inset space ~
1256 \begin_inset space ~
1262 \begin_layout Description
1264 \begin_inset space ~
1268 \begin_inset space ~
1274 \begin_layout Description
1276 \begin_inset space ~
1280 \begin_inset space ~
1283 Style affects all choice menu types
1286 \begin_layout Description
1288 \begin_inset space ~
1292 \begin_inset space ~
1295 Style affects only the combo box style
1298 \begin_layout Description
1300 \begin_inset space ~
1304 \begin_inset space ~
1307 Style affects only the popdown box style
1310 \begin_layout Description
1312 \begin_inset space ~
1316 \begin_inset space ~
1319 Style affects only the radio box style
1322 \begin_layout Description
1324 \begin_inset space ~
1328 \begin_inset space ~
1334 \begin_layout Description
1336 \begin_inset space ~
1340 \begin_inset space ~
1346 \begin_layout Description
1348 \begin_inset space ~
1352 \begin_inset space ~
1358 \begin_layout Text Field Style
1362 \begin_layout Standard
1363 The content of the styles is a comma-separated list of parameters.
1364 The possible parameters are listed in sec.
1365 \begin_inset space \thinspace{}
1369 \begin_inset Quotes eld
1372 Forms optional parameters
1373 \begin_inset Quotes erd
1376 of the documentation of the LaTeX package
1381 \begin_inset CommandInset citation
1388 It is important that the parameter print is always part of the definition,
1389 otherwise the fields won't appear in the PDF output.
1390 The defined style is applied to all fields following the definition.
1393 \begin_layout Subsubsection*
1394 Here are some examples:
1397 \begin_layout Text Field Style
1398 print, bordercolor=red,borderstyle=U, backgroundcolor=lightgray, color=lime,
1399 maxlen=10, align=2, charsize=16pt
1402 \begin_layout Check Box Style
1403 print, borderstyle=S, checkboxsymbol=
1408 \begin_layout Combo Box Style
1409 print, bordercolor={0.33 0.66 0.33}, borderstyle=D
1412 \begin_layout Popdown Box Style
1416 \begin_layout Radio Box Style
1417 print, borderstyle=I, radiosymbol=6
1420 \begin_layout Push Button Style
1421 print, borderstyle=B, bordercolor=lime
1424 \begin_layout Submit Button Style
1425 print, borderwidth=0, bordercolor=white
1428 \begin_layout Reset Button Style
1429 print, bordercolor=lime
1432 \begin_layout Itemize
1433 Text field with gray background, lime text color, a red border only below
1434 the field, right alignment, 16
1435 \begin_inset space \thinspace{}
1438 pt font size and a limitation for maximal 10
1439 \begin_inset space ~
1442 characters to insert:
1443 \begin_inset VSpace defskip
1447 \begin_inset Newline newline
1451 \begin_inset Flex TextField
1454 \begin_layout Plain Layout
1456 Enter your name here:
1464 \begin_layout Standard
1492 \begin_layout Standard
1493 \begin_inset Note Greyedout
1496 \begin_layout Plain Layout
1505 has only an effect for text fields if a
1517 \begin_layout Itemize
1518 Check box with normal border and symbol
1521 \begin_inset VSpace defskip
1525 \begin_inset Newline newline
1529 \begin_inset Flex CheckBox
1532 \begin_layout Plain Layout
1534 Are you older than 18 years?
1542 \begin_layout Standard
1543 The symbol is either specified as number or with the command
1544 \begin_inset Newline newline
1554 \begin_inset Newline newline
1561 is one of the possible numbers listed in Table
1562 \begin_inset space ~
1566 \begin_inset CommandInset citation
1575 \begin_layout Itemize
1576 Combo box with dashed, colored border:
1577 \begin_inset VSpace defskip
1581 \begin_inset Newline newline
1585 \begin_inset Flex ChoiceMenu
1588 \begin_layout Plain Layout
1590 \begin_inset Argument 1
1593 \begin_layout Plain Layout
1599 Albania=Al, Armenia=Ar, Azerbaidschan=Az
1600 \begin_inset Argument 2
1603 \begin_layout Plain Layout
1617 \begin_layout Itemize
1618 Popdown box where only 2
1619 \begin_inset space ~
1622 entries are shown and where the last entry is preselected:
1623 \begin_inset VSpace defskip
1627 \begin_inset Newline newline
1631 \begin_inset Flex ChoiceMenu
1634 \begin_layout Plain Layout
1636 \begin_inset Argument 1
1639 \begin_layout Plain Layout
1640 popdown, name=country2, value=Az
1645 Albania=Al, Armenia=Ar, Azerbaidschan=Az
1646 \begin_inset Argument 2
1649 \begin_layout Plain Layout
1663 \begin_layout Standard
1664 \begin_inset VSpace defskip
1668 \begin_inset Note Greyedout
1671 \begin_layout Plain Layout
1688 has no effect for popdown boxes.
1696 \begin_layout Itemize
1697 Radio box with inverted bevel border and symbol number
1698 \begin_inset space ~
1702 \begin_inset VSpace defskip
1706 \begin_inset Newline newline
1710 \begin_inset Flex ChoiceMenu
1713 \begin_layout Plain Layout
1715 \begin_inset Argument 1
1718 \begin_layout Plain Layout
1725 \begin_inset Argument 2
1728 \begin_layout Plain Layout
1742 \begin_layout Itemize
1743 Push button with a bevel border and colored text:
1744 \begin_inset VSpace defskip
1748 \begin_inset Newline newline
1752 \begin_inset Flex PushButton
1755 \begin_layout Plain Layout
1757 \begin_inset Argument 1
1760 \begin_layout Plain Layout
1761 onclick={app.alert("Why do you click this?")}
1770 textcolor{red}{Don't click on this button!!!}}
1778 \begin_layout Standard
1779 \begin_inset VSpace defskip
1783 \begin_inset Note Greyedout
1786 \begin_layout Plain Layout
1799 has no effect for push, submit and reset buttons.
1807 \begin_layout Standard
1808 As workaround use the command
1814 as described in sec.
1815 \begin_inset space \thinspace{}
1819 \begin_inset Quotes eld
1823 \begin_inset Quotes erd
1836 that is used is used in the scheme
1837 \begin_inset Newline newline
1844 textcolor{color}{characters to color}
1847 \begin_inset Newline newline
1850 In the button above this code was used:
1851 \begin_inset Newline newline
1860 textcolor{red}{Don't click on this button!!!}}
1863 \begin_layout Standard
1864 \begin_inset Note Greyedout
1867 \begin_layout Plain Layout
1880 has no effect for push, submit and reset buttons.
1888 \begin_layout Standard
1889 As workaround use the box method described in sec.
1890 \begin_inset space \thinspace{}
1894 \begin_inset CommandInset ref
1896 reference "sub:Action-button-customization"
1903 \begin_layout Itemize
1904 Submit button without border, with cyan background color and increased height:
1905 \begin_inset VSpace defskip
1909 \begin_inset Newline newline
1913 \begin_inset Flex SubmitButton
1916 \begin_layout Plain Layout
1918 \begin_inset Argument 1
1921 \begin_layout Plain Layout
1935 centering Send your data via mail}}
1941 \begin_inset VSpace bigskip
1947 \begin_layout Itemize
1948 Reset button with a width of 7
1949 \begin_inset space \thinspace{}
1953 \begin_inset VSpace defskip
1957 \begin_inset Newline newline
1961 \begin_inset Flex ResetButton
1964 \begin_layout Plain Layout
1966 \begin_inset Argument 1
1969 \begin_layout Plain Layout
1977 makebox[7cm]{Reset the form}
1985 \begin_layout Section
1986 PDF viewer action buttons
1989 \begin_layout Standard
1990 One often needs basic actions to be done by the PDF viewer program.
1991 For example to print the form.
1992 Such PDF program-specific actions can be triggered by adding inserting
1998 The PDF viewer programs
2006 can handle all possible actions while other PDF viewers might only support
2008 However, all PDF viewer programs support the basic things like printing,
2010 \begin_inset space ~
2013 as, view in fullscreen etc..
2016 \begin_layout Standard
2017 To specify the action insert its name to the
2022 A list with possible actions can be found in sec.
2023 \begin_inset space \thinspace{}
2027 \begin_inset Quotes eld
2030 Acrobat-specific behavior
2031 \begin_inset Quotes erd
2034 of the documentation of the LaTeX package
2039 \begin_inset CommandInset citation
2048 \begin_layout Standard
2049 Here are some examples:
2052 \begin_layout Description
2054 \begin_inset Flex PDFAction
2057 \begin_layout Plain Layout
2059 \begin_inset Argument 1
2062 \begin_layout Plain Layout
2076 \begin_layout Description
2078 \begin_inset space ~
2082 \begin_inset Flex PDFAction
2085 \begin_layout Plain Layout
2087 \begin_inset Argument 1
2090 \begin_layout Plain Layout
2104 \begin_layout Description
2106 \begin_inset space ~
2110 \begin_inset space ~
2114 \begin_inset Flex PDFAction
2117 \begin_layout Plain Layout
2119 \begin_inset Argument 1
2122 \begin_layout Plain Layout
2128 View the form in fullscreen
2136 \begin_layout Subsection
2137 Action button customization
2138 \begin_inset CommandInset label
2140 name "sub:Action-button-customization"
2147 \begin_layout Standard
2148 Customizing the action buttons requires some complicated LaTeX code because
2149 things like the width, height and border separation cannot be specified
2150 as button parameters.
2153 \begin_layout Standard
2154 The easiest way to customize the buttons is to fill it with a custom box:
2157 \begin_layout Enumerate
2158 Create a normal LyX box of your choice
2161 \begin_layout Enumerate
2164 View\SpecialChar \menuseparator
2166 \begin_inset space ~
2171 to show the source code window (if not already shown)
2174 \begin_layout Enumerate
2175 set the cursor into the box and copy the corresponding LaTeX code from the
2179 \begin_layout Enumerate
2180 paste it t the content of the
2187 \begin_layout Standard
2188 For example the button should be 4
2189 \begin_inset space \thinspace{}
2192 cm wide and have the height of 2 lines.
2193 Then create this parbox:
2194 \begin_inset Newline newline
2198 \begin_inset Box Frameless
2208 height_special "totalheight"
2211 \begin_layout Plain Layout
2219 \begin_inset Newline newline
2222 and copy its LaTeX code to the button
2227 To center the text in the button add
2229 centering right before the button text.
2233 \begin_layout Standard
2234 \begin_inset Flex PDFAction
2237 \begin_layout Plain Layout
2239 \begin_inset Argument 1
2242 \begin_layout Plain Layout
2254 centering Save form as}
2262 \begin_layout Standard
2263 To customize the border color, add the command
2265 menubordercolor={r g b}
2267 to the additional options in the document settings under
2270 \begin_inset space ~
2287 with a number between 0 and 1 for the colors red, green and blue.
2288 If you want to change the border color only for certain buttons, use the
2292 \begin_inset space ~
2296 \begin_inset space ~
2301 before the button and insert there the command
2306 The default value of
2317 \begin_layout PDF Link Setup
2318 menubordercolor={0.1 0.9 0.5}
2321 \begin_layout Standard
2324 menubordercolor={0.1 0.9 0.5}
2327 \begin_inset Newline newline
2331 \begin_inset Flex PDFAction
2334 \begin_layout Plain Layout
2336 \begin_inset Argument 1
2339 \begin_layout Plain Layout
2351 centering Save form as}
2359 \begin_layout Standard
2360 To change the border width use the command
2368 is the width in pixels.
2369 The default value of
2380 \begin_layout Standard
2381 \begin_inset Note Greyedout
2384 \begin_layout Plain Layout
2393 affects all link types, not only the menu links.
2401 \begin_layout PDF Link Setup
2402 pdfborder={0 0 4}, menubordercolor={1 1 0}
2405 \begin_layout Standard
2407 \begin_inset space ~
2410 pixel thick yellow border:
2411 \begin_inset Newline newline
2415 \begin_inset Flex PDFAction
2418 \begin_layout Plain Layout
2420 \begin_inset Argument 1
2423 \begin_layout Plain Layout
2435 centering Save form as}
2443 \begin_layout Standard
2444 To change the background color insert the command
2450 at the beginning of the button inset and a
2459 is hereby the name of the color as described in sec.
2460 \begin_inset space \thinspace{}
2464 \begin_inset Quotes eld
2468 \begin_inset Quotes erd
2478 \begin_layout PDF Link Setup
2482 \begin_layout Standard
2483 An example without a border and with a background color:
2484 \begin_inset Newline newline
2488 \begin_inset Flex PDFAction
2491 \begin_layout Plain Layout
2493 \begin_inset Argument 1
2496 \begin_layout Plain Layout
2510 centering Save form as}}
2518 \begin_layout PDF Link Setup
2519 pdfborder={0 0 1}, menubordercolor={1 0 0}
2522 \begin_layout Section
2526 \begin_layout Standard
2527 It is also possible to have dynamic form fields.
2528 This means that depending on the actions of the user fields can (dis)appear
2529 or change their appearance.
2530 To use this feature, add these lines to your document preamble:
2533 \begin_layout Standard
2538 usepackage[pdftex]{insdljs}
2539 \begin_inset Newline newline
2553 \begin_layout Standard
2554 Then add the necessary JavaScript code to your preamble or as TeX code to
2556 For info about JavaScript, see its documentation,
2557 \begin_inset CommandInset citation
2566 \begin_layout Standard
2570 \begin_layout Plain Layout
2580 \begin_inset Note Note
2583 \begin_layout Plain Layout
2584 The following section will only be displayed when the LaTeX package
2596 \begin_layout Standard
2597 For the following choice menu this JavaScript code was used:
2600 \begin_layout Standard
2601 \begin_inset listings
2602 lstparams "language=TeX"
2606 \begin_layout Plain Layout
2610 begin{insDLJS}[exaaae]{exaaae}{JavaScript}
2613 \begin_layout Plain Layout
2615 function validateTime(){
2618 \begin_layout Plain Layout
2623 \begin_layout Plain Layout
2625 if((event.value == "u") || (event.value == "unlimited")) {
2628 \begin_layout Plain Layout
2630 this.getField("from").display = display.hidden;
2633 \begin_layout Plain Layout
2635 this.getField("to").display = display.hidden;
2638 \begin_layout Plain Layout
2643 \begin_layout Plain Layout
2645 this.getField("from").display = display.visible;
2648 \begin_layout Plain Layout
2650 this.getField("to").display = display.visible;
2653 \begin_layout Plain Layout
2655 this.getField("from").setFocus();
2658 \begin_layout Plain Layout
2663 \begin_layout Plain Layout
2668 \begin_layout Plain Layout
2673 \begin_layout Plain Layout
2685 \begin_layout Standard
2689 \begin_inset space ~
2693 \begin_inset space ~
2698 of the following choice menu are
2699 \begin_inset Newline newline
2704 name=contract,radio,value=tl,default=tl,validate={validateTime();}
2707 \begin_layout Standard
2708 \begin_inset Flex ChoiceMenu
2711 \begin_layout Plain Layout
2713 \begin_inset Argument 1
2716 \begin_layout Plain Layout
2717 name=contract,radio,value=tl,default=tl,validate={validateTime();}
2722 term-limited=tl, unlimited=u
2723 \begin_inset Argument 2
2726 \begin_layout Plain Layout
2738 \begin_inset VSpace defskip
2744 \begin_layout Standard
2745 \begin_inset Tabular
2746 <lyxtabular version="3" rows="3" columns="2">
2747 <features rotate="0" tabularvalignment="middle">
2748 <column alignment="left" valignment="top">
2749 <column alignment="center" valignment="top">
2751 <cell alignment="left" valignment="top" usebox="none">
2754 \begin_layout Plain Layout
2760 <cell alignment="center" valignment="top" usebox="none">
2763 \begin_layout Plain Layout
2764 \begin_inset Flex TextField
2767 \begin_layout Plain Layout
2769 \begin_inset Argument 1
2772 \begin_layout Plain Layout
2773 name=from,width=10em
2790 <cell alignment="center" valignment="top" usebox="none">
2793 \begin_layout Plain Layout
2799 <cell alignment="center" valignment="top" usebox="none">
2802 \begin_layout Plain Layout
2803 \begin_inset VSpace -1.5mm
2813 <cell alignment="left" valignment="top" usebox="none">
2816 \begin_layout Plain Layout
2822 <cell alignment="center" valignment="top" usebox="none">
2825 \begin_layout Plain Layout
2826 \begin_inset Flex TextField
2829 \begin_layout Plain Layout
2831 \begin_inset Argument 1
2834 \begin_layout Plain Layout
2858 \begin_layout Standard
2862 \begin_layout Plain Layout
2872 \begin_inset Note Note
2875 \begin_layout Plain Layout
2876 The following will be displayed when the LaTeX package
2888 \begin_layout Standard
2889 You need to install the package
2893 to see the content of this section in the output.
2896 \begin_layout Standard
2900 \begin_layout Plain Layout
2912 \begin_layout End PDF Form
2913 \begin_inset Note Note
2916 \begin_layout Plain Layout
2925 \begin_layout Section
2929 \begin_layout Itemize
2930 All braces and brackets in form parameters must be inserted as TeX code!
2933 \begin_layout Itemize
2934 To be able to use all kinds of colors and color definitions you must load
2939 in the document preamble this way:
2940 \begin_inset Newline newline
2947 usepackage[svgnames,rgb]{xcolor}
2950 \begin_layout Itemize
2959 custom background colors you must disable in these programs to highlight
2960 the available form fields in the PDF.
2963 \begin_layout Bibliography
2964 \begin_inset CommandInset bibitem
2965 LatexCommand bibitem
2971 \begin_inset CommandInset href
2973 name "JavaScript reference"
2974 target "https://developer.mozilla.org/en/docs/Web/JavaScript/Reference"
2981 \begin_layout Bibliography
2982 \begin_inset CommandInset bibitem
2983 LatexCommand bibitem
2989 \begin_inset CommandInset href
2991 name "Documentation"
2992 target "http://mirrors.ctan.org/macros/latex/contrib/hyperref/doc/manual.pdf"
2996 of the LaTeX package
3003 \begin_layout Bibliography
3004 \begin_inset CommandInset bibitem
3005 LatexCommand bibitem
3011 \begin_inset CommandInset href
3013 name "Documentation"
3014 target "http://mirrors.ctan.org/macros/latex/required/psnfss/psnfss2e.pdf"
3018 of the LaTeX package