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
388 There insert for example the parameter
397 Only if your text field has a label and no parameters the specification
398 of the name can be omitted.
401 \begin_layout Standard
402 \begin_inset Note Greyedout
405 \begin_layout Plain Layout
410 All braces and brackets in form parameters must be inserted as TeX code!
418 \begin_layout Standard
419 All form fields can be customized by adding parameters.
422 \begin_layout Standard
423 Here is a customized multiline text field with a width of 5
424 \begin_inset space \thinspace{}
427 cm and a proposed content:
428 \begin_inset VSpace defskip
432 \begin_inset Newline newline
436 \begin_inset Flex TextField
439 \begin_layout Plain Layout
441 \begin_inset Argument 1
444 \begin_layout Plain Layout
445 name=customer2, width=5cm, multiline, width=0.6
447 textwidth, height=3cm, value={Testman}
452 Enter your name here:
460 \begin_layout Standard
461 \begin_inset Note Greyedout
464 \begin_layout Plain Layout
469 It is highly recommended to use a uniform layout of all fields in your
472 \begin_inset space \thinspace{}
476 \begin_inset CommandInset ref
478 reference "sec:Form-field-customization"
482 for how this is done.
490 \begin_layout Subsection
494 \begin_layout Standard
495 A check box is added by inserting the custom inset
500 Write inside the inset the label for the box.
502 \begin_inset Newline newline
506 \begin_inset Flex CheckBox
509 \begin_layout Plain Layout
511 \begin_inset Argument 1
514 \begin_layout Plain Layout
520 Are you older than 18 years?
528 \begin_layout Standard
529 You must also specify a field name for check boxes: Insert for example the
538 is the field name) into the
543 Only if your check box has a label and no parameters the specification
544 of the name can be omitted.
547 \begin_layout Subsection
551 \begin_layout Standard
552 A choice menu is added by inserting the custom inset
557 A label for the inset is added by using the menu
559 Insert\SpecialChar \menuseparator
563 Insert the label text into this inset.
564 \begin_inset Newline newline
567 The different choices are inserted to the inset as comma-separated list.
575 \begin_layout Description
576 Radio Only one choice can be selected
579 \begin_layout Description
580 Combo The choices are listed in a combo box (dropdown list) but the user
581 is allowed to choose something that is not in the predefined list.
584 \begin_layout Description
585 Popdown All choices are listed below each other.
586 It the filed is not high enough a scroll bar is automatically added to
590 \begin_layout Standard
591 To determine the choice menu type, add the parameter
606 \begin_layout Standard
607 Here is an example for the radio type:
608 \begin_inset Newline newline
612 \begin_inset Flex ChoiceMenu
615 \begin_layout Plain Layout
617 \begin_inset Argument 1
620 \begin_layout Plain Layout
627 \begin_inset Argument 2
630 \begin_layout Plain Layout
644 \begin_layout Standard
645 Here is an example for the combo type:
646 \begin_inset Newline newline
650 \begin_inset Flex ChoiceMenu
653 \begin_layout Plain Layout
655 \begin_inset Argument 1
658 \begin_layout Plain Layout
664 Albania=Al, Armenia=Ar, Azerbaidschan=Az
665 \begin_inset Argument 2
668 \begin_layout Plain Layout
682 \begin_layout Standard
683 Here is an example for the popdown type:
684 \begin_inset Newline newline
688 \begin_inset Flex ChoiceMenu
691 \begin_layout Plain Layout
693 \begin_inset Argument 1
696 \begin_layout Plain Layout
697 popdown, name=country
702 Albania=Al, Armenia=Ar, Azerbaidschan=Az
703 \begin_inset Argument 2
706 \begin_layout Plain Layout
720 \begin_layout Standard
721 \begin_inset Note Greyedout
724 \begin_layout Plain Layout
729 For the popdown type you must always specify a field name: Add to the
741 for example the parameter
757 \begin_layout Standard
758 It is recommended to add a short name for every choice to be able to access
759 them and to know which one was chosen by the user.
760 This is done by adding
764 behind each choice (where
769 For example the radio type example contains this choice list:
775 \begin_inset Quotes eld
779 \begin_inset Quotes erd
782 you know that he chose the choice
783 \begin_inset Quotes eld
787 \begin_inset Quotes erd
791 By specifying names you can also preset/propose e.g.
792 \begin_inset space \space{}
796 \begin_inset Quotes eld
800 \begin_inset Quotes erd
803 by adding the parameter
811 \begin_layout Standard
812 \begin_inset Flex ChoiceMenu
815 \begin_layout Plain Layout
817 \begin_inset Argument 1
820 \begin_layout Plain Layout
821 radio, name=sex, default=m
827 \begin_inset Argument 2
830 \begin_layout Plain Layout
844 \begin_layout Standard
845 \begin_inset Note Greyedout
848 \begin_layout Plain Layout
853 Due to a bug in the LaTeX package
857 it is currently only possible the set the first choice as default.
865 \begin_layout Subsection
869 \begin_layout Standard
870 A push button is added by inserting the custom inset
875 Write inside the inset the label for the button.
877 \begin_inset Newline newline
881 \begin_inset Flex PushButton
884 \begin_layout Plain Layout
886 Don't click on this button or your fridge will be destroyed!!!
894 \begin_layout Standard
895 The action that is triggered by pressing the button is specified by JavaScript
897 To specify it, add the parameter
901 and write the JavaScript code between the braces.
904 \begin_layout Standard
905 \begin_inset Flex PushButton
908 \begin_layout Plain Layout
910 \begin_inset Argument 1
913 \begin_layout Plain Layout
914 onclick={app.alert("What the hell? Now you destroyed your fridge.
920 Don't click on this button or your fridge will be destroyed!!!
928 \begin_layout Standard
929 For info about JavaScript, see its documentation,
930 \begin_inset CommandInset citation
939 \begin_layout Standard
940 A common usage for pus buttons is to open a weblink.
941 Such a button is created by inserting the command
947 into the button inset.
954 is used in the scheme
955 \begin_inset Newline newline
962 href{link target}{text}
965 \begin_layout Standard
966 In the following button this code was used:
967 \begin_inset Newline newline
974 href{http://wiki.lyx.org}{Information how to fill out this form}
977 \begin_layout Standard
978 \begin_inset Flex PushButton
981 \begin_layout Plain Layout
985 href{http://wiki.lyx.org}{Information how to fill out this form}
993 \begin_layout Standard
994 To get rid of the frame for weblinks add this to the additional options
995 in the document settings under
1006 \begin_layout Standard
1009 urlbordercolor={1 0 0}
1012 \begin_layout Standard
1013 if your push button border color is red (the default), otherwise use the
1014 same color definition as for your push button border color.
1017 \begin_layout Subsection
1021 \begin_layout Standard
1022 A submit button is used to submit the form data to a server.
1023 It is added by inserting the custom inset
1028 Write inside the inset the label for the button.
1030 \begin_inset Newline newline
1034 \begin_inset Flex SubmitButton
1037 \begin_layout Plain Layout
1039 \begin_inset Argument 1
1042 \begin_layout Plain Layout
1048 Send your data via email
1056 \begin_layout Standard
1057 \begin_inset Note Greyedout
1060 \begin_layout Plain Layout
1065 You can only use a submit button if you specified the submit method and
1066 target in the PDF form environment options! See sec.
1067 \begin_inset space \thinspace{}
1071 \begin_inset CommandInset ref
1073 reference "sec:Preparation"
1077 for the description.
1078 If there are no specifications you will get LaTeX errors!
1086 \begin_layout Standard
1087 \begin_inset Note Greyedout
1090 \begin_layout Plain Layout
1095 If you have more than one submit button in your document you must specify
1096 a name for each of them to avoid LaTeX errors! For example add
1104 is the button name).
1112 \begin_layout Subsection
1116 \begin_layout Standard
1117 A reset button is used to reset all form fields to the initial state.
1118 It is added by inserting the custom inset
1123 Write inside the inset the label for the button.
1125 \begin_inset Newline newline
1129 \begin_inset Flex ResetButton
1132 \begin_layout Plain Layout
1134 \begin_inset Argument 1
1137 \begin_layout Plain Layout
1151 \begin_layout Standard
1152 \begin_inset Note Greyedout
1155 \begin_layout Plain Layout
1160 If you have more than one reset button in your document you must specify
1161 a name for each of them to avoid LaTeX errors! For example add
1169 is the button name).
1177 \begin_layout Section
1178 Form field customization
1179 \begin_inset CommandInset label
1181 name "sec:Form-field-customization"
1188 \begin_layout Standard
1189 Since all form elements should look uniform, one can determine their layout
1190 using the following styles:
1193 \begin_layout Description
1195 \begin_inset space ~
1199 \begin_inset space ~
1205 \begin_layout Description
1207 \begin_inset space ~
1211 \begin_inset space ~
1217 \begin_layout Description
1219 \begin_inset space ~
1223 \begin_inset space ~
1226 Style affects all choice menu types
1229 \begin_layout Description
1231 \begin_inset space ~
1235 \begin_inset space ~
1238 Style affects only the combo box style
1241 \begin_layout Description
1243 \begin_inset space ~
1247 \begin_inset space ~
1250 Style affects only the popdown box style
1253 \begin_layout Description
1255 \begin_inset space ~
1259 \begin_inset space ~
1262 Style affects only the radio box style
1265 \begin_layout Description
1267 \begin_inset space ~
1271 \begin_inset space ~
1277 \begin_layout Description
1279 \begin_inset space ~
1283 \begin_inset space ~
1289 \begin_layout Description
1291 \begin_inset space ~
1295 \begin_inset space ~
1301 \begin_layout Text Field Style
1305 \begin_layout Standard
1306 The content of the styles is a comma-separated list of parameters.
1307 The possible parameters are listed in sec.
1308 \begin_inset space \thinspace{}
1312 \begin_inset Quotes eld
1315 Forms optional parameters
1316 \begin_inset Quotes erd
1319 of the documentation of the LaTeX package
1324 \begin_inset CommandInset citation
1331 It is important that the parameter print is always part of the definition,
1332 otherwise the fields won't appear in the PDF output.
1333 The defined style is applied to all fields following the definition.
1336 \begin_layout Subsubsection*
1337 Here are some examples:
1340 \begin_layout Text Field Style
1341 print, bordercolor=red,borderstyle=U, backgroundcolor=lightgray, color=lime,
1342 maxlen=10, align=2, charsize=16pt
1345 \begin_layout Check Box Style
1346 print, borderstyle=S, checkboxsymbol=
1351 \begin_layout Combo Box Style
1352 print, bordercolor={0.33 0.66 0.33}, borderstyle=D
1355 \begin_layout Popdown Box Style
1359 \begin_layout Radio Box Style
1360 print, borderstyle=I, radiosymbol=6
1363 \begin_layout Push Button Style
1364 print, borderstyle=B, bordercolor=lime
1367 \begin_layout Submit Button Style
1368 print, borderwidth=0, bordercolor=white
1371 \begin_layout Reset Button Style
1372 print, bordercolor=lime
1375 \begin_layout Itemize
1376 Text field with gray background, lime text color, a red border only below
1377 the field, right alignment, 16
1378 \begin_inset space \thinspace{}
1381 pt font size and a limitation for maximal 10
1382 \begin_inset space ~
1385 characters to insert:
1386 \begin_inset VSpace defskip
1390 \begin_inset Newline newline
1394 \begin_inset Flex TextField
1397 \begin_layout Plain Layout
1399 Enter your name here:
1407 \begin_layout Standard
1435 \begin_layout Standard
1436 \begin_inset Note Greyedout
1439 \begin_layout Plain Layout
1448 has only an effect for text fields if a
1460 \begin_layout Itemize
1461 Check box with normal border and symbol
1464 \begin_inset VSpace defskip
1468 \begin_inset Newline newline
1472 \begin_inset Flex CheckBox
1475 \begin_layout Plain Layout
1477 Are you older than 18 years?
1485 \begin_layout Standard
1486 The symbol is either specified as number or with the command
1487 \begin_inset Newline newline
1497 \begin_inset Newline newline
1504 is one of the possible numbers listed in Table
1505 \begin_inset space ~
1509 \begin_inset CommandInset citation
1518 \begin_layout Itemize
1519 Combo box with dashed, colored border:
1520 \begin_inset VSpace defskip
1524 \begin_inset Newline newline
1528 \begin_inset Flex ChoiceMenu
1531 \begin_layout Plain Layout
1533 \begin_inset Argument 1
1536 \begin_layout Plain Layout
1542 Albania=Al, Armenia=Ar, Azerbaidschan=Az
1543 \begin_inset Argument 2
1546 \begin_layout Plain Layout
1560 \begin_layout Itemize
1561 Popdown box where only 2
1562 \begin_inset space ~
1565 entries are shown and where the last entry is preselected:
1566 \begin_inset VSpace defskip
1570 \begin_inset Newline newline
1574 \begin_inset Flex ChoiceMenu
1577 \begin_layout Plain Layout
1579 \begin_inset Argument 1
1582 \begin_layout Plain Layout
1583 popdown, name=country2, value=Az
1588 Albania=Al, Armenia=Ar, Azerbaidschan=Az
1589 \begin_inset Argument 2
1592 \begin_layout Plain Layout
1606 \begin_layout Standard
1607 \begin_inset VSpace defskip
1611 \begin_inset Note Greyedout
1614 \begin_layout Plain Layout
1631 has no effect for popdown boxes.
1639 \begin_layout Itemize
1640 Radio box with inverted bevel border and symbol number
1641 \begin_inset space ~
1645 \begin_inset VSpace defskip
1649 \begin_inset Newline newline
1653 \begin_inset Flex ChoiceMenu
1656 \begin_layout Plain Layout
1658 \begin_inset Argument 1
1661 \begin_layout Plain Layout
1668 \begin_inset Argument 2
1671 \begin_layout Plain Layout
1685 \begin_layout Itemize
1686 Push button with a bevel border and colored text:
1687 \begin_inset VSpace defskip
1691 \begin_inset Newline newline
1695 \begin_inset Flex PushButton
1698 \begin_layout Plain Layout
1700 \begin_inset Argument 1
1703 \begin_layout Plain Layout
1704 onclick={app.alert("Why do you click this?")}
1713 textcolor{red}{Don't click on this button!!!}}
1721 \begin_layout Standard
1722 \begin_inset VSpace defskip
1726 \begin_inset Note Greyedout
1729 \begin_layout Plain Layout
1742 has no effect for push, submit and reset buttons.
1750 \begin_layout Standard
1751 As workaround use the command
1757 as described in sec.
1758 \begin_inset space \thinspace{}
1762 \begin_inset Quotes eld
1766 \begin_inset Quotes erd
1779 that is used is used in the scheme
1780 \begin_inset Newline newline
1787 textcolor{color}{characters to color}
1790 \begin_inset Newline newline
1793 In the button above this code was used:
1794 \begin_inset Newline newline
1803 textcolor{red}{Don't click on this button!!!}}
1806 \begin_layout Standard
1807 \begin_inset Note Greyedout
1810 \begin_layout Plain Layout
1823 has no effect for push, submit and reset buttons.
1831 \begin_layout Standard
1832 As workaround use the box method described in sec.
1833 \begin_inset space \thinspace{}
1837 \begin_inset CommandInset ref
1839 reference "sub:Action-button-customization"
1846 \begin_layout Itemize
1847 Submit button without border, with cyan background color and increased height:
1848 \begin_inset VSpace defskip
1852 \begin_inset Newline newline
1856 \begin_inset Flex SubmitButton
1859 \begin_layout Plain Layout
1861 \begin_inset Argument 1
1864 \begin_layout Plain Layout
1878 centering Send your data via mail}}
1884 \begin_inset VSpace bigskip
1890 \begin_layout Itemize
1891 Reset button with a width of 7
1892 \begin_inset space \thinspace{}
1896 \begin_inset VSpace defskip
1900 \begin_inset Newline newline
1904 \begin_inset Flex ResetButton
1907 \begin_layout Plain Layout
1909 \begin_inset Argument 1
1912 \begin_layout Plain Layout
1920 makebox[7cm]{Reset the form}
1928 \begin_layout Section
1929 PDF viewer action buttons
1932 \begin_layout Standard
1933 One often needs basic actions to be done by the PDF viewer program.
1934 For example to print the form.
1935 Such PDF program-specific actions can be triggered by adding inserting
1941 The PDF viewer programs
1949 can handle all possible actions while other PDF viewers might only support
1951 However, all PDF viewer programs support the basic things like printing,
1953 \begin_inset space ~
1956 as, view in fullscreen etc..
1959 \begin_layout Standard
1960 To specify the action insert its name to the
1965 A list with possible actions can be found in sec.
1966 \begin_inset space \thinspace{}
1970 \begin_inset Quotes eld
1973 Acrobat-specific behavior
1974 \begin_inset Quotes erd
1977 of the documentation of the LaTeX package
1982 \begin_inset CommandInset citation
1991 \begin_layout Standard
1992 Here are some examples:
1995 \begin_layout Description
1997 \begin_inset Flex PDFAction
2000 \begin_layout Plain Layout
2002 \begin_inset Argument 1
2005 \begin_layout Plain Layout
2019 \begin_layout Description
2021 \begin_inset space ~
2025 \begin_inset Flex PDFAction
2028 \begin_layout Plain Layout
2030 \begin_inset Argument 1
2033 \begin_layout Plain Layout
2047 \begin_layout Description
2049 \begin_inset space ~
2053 \begin_inset space ~
2057 \begin_inset Flex PDFAction
2060 \begin_layout Plain Layout
2062 \begin_inset Argument 1
2065 \begin_layout Plain Layout
2071 View the form in fullscreen
2079 \begin_layout Subsection
2080 Action button customization
2081 \begin_inset CommandInset label
2083 name "sub:Action-button-customization"
2090 \begin_layout Standard
2091 Customizing the action buttons requires some complicated LaTeX code because
2092 things like the width, height and border separation cannot be specified
2093 as button parameters.
2096 \begin_layout Standard
2097 The easiest way to customize the buttons is to fill it with a custom box:
2100 \begin_layout Enumerate
2101 Create a normal LyX box of your choice
2104 \begin_layout Enumerate
2107 View\SpecialChar \menuseparator
2109 \begin_inset space ~
2114 to show the source code window (if not already shown)
2117 \begin_layout Enumerate
2118 set the cursor into the box and copy the corresponding LaTeX code from the
2122 \begin_layout Enumerate
2123 paste it t the content of the
2130 \begin_layout Standard
2131 For example the button should be 4
2132 \begin_inset space \thinspace{}
2135 cm wide and have the height of 2 lines.
2136 Then create this parbox:
2137 \begin_inset Newline newline
2141 \begin_inset Box Frameless
2151 height_special "totalheight"
2154 \begin_layout Plain Layout
2162 \begin_inset Newline newline
2165 and copy its LaTeX code to the button
2170 To center the text in the button add
2172 centering right before the button text.
2176 \begin_layout Standard
2177 \begin_inset Flex PDFAction
2180 \begin_layout Plain Layout
2182 \begin_inset Argument 1
2185 \begin_layout Plain Layout
2197 centering Save form as}
2205 \begin_layout Standard
2206 To customize the border color, add the command
2208 menubordercolor={r g b}
2210 to the additional options in the document settings under
2213 \begin_inset space ~
2230 with a number between 0 and 1 for the colors red, green and blue.
2231 If you want to change the border color only for certain buttons, use the
2235 \begin_inset space ~
2239 \begin_inset space ~
2244 before the button and insert there the command
2249 The default value of
2260 \begin_layout PDF Link Setup
2261 menubordercolor={0.1 0.9 0.5}
2264 \begin_layout Standard
2267 menubordercolor={0.1 0.9 0.5}
2270 \begin_inset Newline newline
2274 \begin_inset Flex PDFAction
2277 \begin_layout Plain Layout
2279 \begin_inset Argument 1
2282 \begin_layout Plain Layout
2294 centering Save form as}
2302 \begin_layout Standard
2303 To change the border width use the command
2311 is the width in pixels.
2312 The default value of
2323 \begin_layout Standard
2324 \begin_inset Note Greyedout
2327 \begin_layout Plain Layout
2336 affects all link types, not only the menu links.
2344 \begin_layout PDF Link Setup
2345 pdfborder={0 0 4}, menubordercolor={1 1 0}
2348 \begin_layout Standard
2350 \begin_inset space ~
2353 pixel thick yellow border:
2354 \begin_inset Newline newline
2358 \begin_inset Flex PDFAction
2361 \begin_layout Plain Layout
2363 \begin_inset Argument 1
2366 \begin_layout Plain Layout
2378 centering Save form as}
2386 \begin_layout Standard
2387 To change the background color insert the command
2393 at the beginning of the button inset and a
2402 is hereby the name of the color as described in sec.
2403 \begin_inset space \thinspace{}
2407 \begin_inset Quotes eld
2411 \begin_inset Quotes erd
2421 \begin_layout PDF Link Setup
2425 \begin_layout Standard
2426 An example without a border and with a background color:
2427 \begin_inset Newline newline
2431 \begin_inset Flex PDFAction
2434 \begin_layout Plain Layout
2436 \begin_inset Argument 1
2439 \begin_layout Plain Layout
2453 centering Save form as}}
2461 \begin_layout PDF Link Setup
2462 pdfborder={0 0 1}, menubordercolor={1 0 0}
2465 \begin_layout Section
2469 \begin_layout Standard
2470 It is also possible to have dynamic form fields.
2471 This means that depending on the actions of the user fields can (dis)appear
2472 or change their appearance.
2473 To use this feature, add these lines to your document preamble:
2476 \begin_layout Standard
2481 usepackage[pdftex]{insdljs}
2482 \begin_inset Newline newline
2496 \begin_layout Standard
2497 Then add the necessary JavaScript code to your preamble or as TeX code to
2499 For info about JavaScript, see its documentation,
2500 \begin_inset CommandInset citation
2509 \begin_layout Standard
2513 \begin_layout Plain Layout
2523 \begin_inset Note Note
2526 \begin_layout Plain Layout
2527 The following section will only be displayed when the LaTeX package
2539 \begin_layout Standard
2540 For the following choice menu this JavaScript code was used:
2543 \begin_layout Standard
2544 \begin_inset listings
2545 lstparams "language=TeX"
2549 \begin_layout Plain Layout
2553 begin{insDLJS}[exaaae]{exaaae}{JavaScript}
2556 \begin_layout Plain Layout
2558 function validateTime(){
2561 \begin_layout Plain Layout
2566 \begin_layout Plain Layout
2568 if((event.value == "u") || (event.value == "unlimited")) {
2571 \begin_layout Plain Layout
2573 this.getField("from").display = display.hidden;
2576 \begin_layout Plain Layout
2578 this.getField("to").display = display.hidden;
2581 \begin_layout Plain Layout
2586 \begin_layout Plain Layout
2588 this.getField("from").display = display.visible;
2591 \begin_layout Plain Layout
2593 this.getField("to").display = display.visible;
2596 \begin_layout Plain Layout
2598 this.getField("from").setFocus();
2601 \begin_layout Plain Layout
2606 \begin_layout Plain Layout
2611 \begin_layout Plain Layout
2616 \begin_layout Plain Layout
2628 \begin_layout Standard
2632 \begin_inset space ~
2636 \begin_inset space ~
2641 of the following choice menu are
2642 \begin_inset Newline newline
2647 name=contract,radio,value=tl,default=tl,validate={validateTime();}
2650 \begin_layout Standard
2651 \begin_inset Flex ChoiceMenu
2654 \begin_layout Plain Layout
2656 \begin_inset Argument 1
2659 \begin_layout Plain Layout
2660 name=contract,radio,value=tl,default=tl,validate={validateTime();}
2665 term-limited=tl, unlimited=u
2666 \begin_inset Argument 2
2669 \begin_layout Plain Layout
2681 \begin_inset VSpace defskip
2687 \begin_layout Standard
2688 \begin_inset Tabular
2689 <lyxtabular version="3" rows="3" columns="2">
2690 <features rotate="0" tabularvalignment="middle">
2691 <column alignment="left" valignment="top">
2692 <column alignment="center" valignment="top">
2694 <cell alignment="left" valignment="top" usebox="none">
2697 \begin_layout Plain Layout
2703 <cell alignment="center" valignment="top" usebox="none">
2706 \begin_layout Plain Layout
2707 \begin_inset Flex TextField
2710 \begin_layout Plain Layout
2712 \begin_inset Argument 1
2715 \begin_layout Plain Layout
2716 name=from,width=10em
2733 <cell alignment="center" valignment="top" usebox="none">
2736 \begin_layout Plain Layout
2742 <cell alignment="center" valignment="top" usebox="none">
2745 \begin_layout Plain Layout
2746 \begin_inset VSpace -1.5mm
2756 <cell alignment="left" valignment="top" usebox="none">
2759 \begin_layout Plain Layout
2765 <cell alignment="center" valignment="top" usebox="none">
2768 \begin_layout Plain Layout
2769 \begin_inset Flex TextField
2772 \begin_layout Plain Layout
2774 \begin_inset Argument 1
2777 \begin_layout Plain Layout
2801 \begin_layout Standard
2805 \begin_layout Plain Layout
2815 \begin_inset Note Note
2818 \begin_layout Plain Layout
2819 The following will be displayed when the LaTeX package
2831 \begin_layout Standard
2832 You need to install the package
2836 to see the content of this section in the output.
2839 \begin_layout Standard
2843 \begin_layout Plain Layout
2855 \begin_layout End PDF Form
2856 \begin_inset Note Note
2859 \begin_layout Plain Layout
2868 \begin_layout Section
2872 \begin_layout Itemize
2873 All braces and brackets in form parameters must be inserted as TeX code!
2876 \begin_layout Itemize
2877 To be able to use all kinds of colors and color definitions you must load
2882 in the document preamble this way:
2883 \begin_inset Newline newline
2890 usepackage[svgnames,rgb]{xcolor}
2893 \begin_layout Itemize
2902 custom background colors you must disable in these programs to highlight
2903 the available form fields in the PDF.
2906 \begin_layout Bibliography
2907 \begin_inset CommandInset bibitem
2908 LatexCommand bibitem
2914 \begin_inset CommandInset href
2916 name "JavaScript reference"
2917 target "https://developer.mozilla.org/en/docs/Web/JavaScript/Reference"
2924 \begin_layout Bibliography
2925 \begin_inset CommandInset bibitem
2926 LatexCommand bibitem
2932 \begin_inset CommandInset href
2934 name "Documentation"
2935 target "http://mirrors.ctan.org/macros/latex/contrib/hyperref/doc/manual.pdf"
2939 of the LaTeX package
2946 \begin_layout Bibliography
2947 \begin_inset CommandInset bibitem
2948 LatexCommand bibitem
2954 \begin_inset CommandInset href
2956 name "Documentation"
2957 target "http://mirrors.ctan.org/macros/latex/required/psnfss/psnfss2e.pdf"
2961 of the LaTeX package