1 #LyX 2.2 created this file. For more info see http://www.lyx.org/
8 % used to check for needed LaTeX packages
11 % check for package insdljs
12 % used for JavScript code
14 \IfFileExists{insdljs.sty}
15 {\usepackage[pdftex]{insdljs}
16 \setboolean{insdljs}{true}}
17 {\setboolean{insdljs}{false}}
19 \pdfcatalog{/AA \the\pdflastobj\space 0 R}
21 \ifinsdljs % only execute if package insdljs is installed
23 \begin{insDLJS}[exaaae]{exaaae}{JavaScript}
25 function validateTime(){
27 if((event.value == "u") || (event.value == "unlimited")) {
28 this.getField("from").display = display.hidden;
29 this.getField("to").display = display.hidden;
31 this.getField("from").display = display.visible;
32 this.getField("to").display = display.visible;
33 this.getField("from").setFocus();
38 function checkNumber() {
40 if (!Number(event.value))
42 app.alert("Value must be a number!");
45 event.target.textColor = color.green;
58 % set fonts for nicer pdf view
59 \IfFileExists{lmodern.sty}
60 {\usepackage{lmodern}}{}
62 \fi % end if pdflatex is used
64 \options BCOR8mm,pagesize
65 \use_default_options false
69 \maintain_unincluded_children false
71 \language_package default
74 \font_roman "default" "default"
75 \font_sans "default" "default"
76 \font_typewriter "default" "default"
77 \font_math "auto" "auto"
78 \font_default_family default
79 \use_non_tex_fonts false
82 \font_sf_scale 100 100
83 \font_tt_scale 100 100
85 \default_output_format default
87 \bibtex_command bibtex
88 \index_command default
92 \pdf_title "Description of the module pdfcomment"
93 \pdf_author "Uwe Stöhr"
94 \pdf_subject "PDF form"
95 \pdf_keywords "LyX, PDF forms, hyperref"
97 \pdf_bookmarksnumbered true
98 \pdf_bookmarksopen true
99 \pdf_bookmarksopenlevel 2
100 \pdf_breaklinks false
102 \pdf_colorlinks false
104 \pdf_pdfusetitle false
105 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue, pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false, urlbordercolor={1 0 0}"
108 \use_package amsmath 1
109 \use_package amssymb 1
110 \use_package cancel 0
112 \use_package mathdots 1
113 \use_package mathtools 1
114 \use_package mhchem 1
115 \use_package stackrel 0
116 \use_package stmaryrd 0
117 \use_package undertilde 0
119 \cite_engine_type default
123 \paperorientation portrait
127 \notefontcolor #0000ff
134 \paragraph_separation skip
136 \quotes_language english
139 \paperpagestyle default
140 \tracking_changes false
141 \output_changes false
144 \html_be_strict false
149 \begin_layout Begin PDF Form
151 \begin_inset Argument 1
154 \begin_layout Plain Layout
155 action=mailto:forms@lyx.test?subject=The submitted PDF form, method=post
164 Description of the module PDF Form
171 \begin_layout Standard
172 \begin_inset Note Note
175 \begin_layout Plain Layout
176 To export all parts of this document to PDF the \SpecialChar LaTeX
182 If it is not installed you can export the document anyway but the example
183 in the section about dynamic form fields won't appear in the output.
191 \begin_layout Standard
192 By loading the module PDF
196 Form the whole document or a part of it can be made a PDF form.
197 You can add all possible form elements like text fields buttons etc.
198 This document describes how this is done.
201 \begin_layout Section
203 \begin_inset CommandInset label
205 name "sec:Preparation"
212 \begin_layout Standard
213 At first load the module PDF
217 Form in the document settings of your file.
218 To make the whole document a form, insert the environment
230 from \SpecialChar LyX
231 's dropdown menu at the beginning of the document.
232 If only a part of the document should be a form, add
244 at the position where the form should start.
247 \begin_layout Standard
248 \begin_inset Note Greyedout
251 \begin_layout Plain Layout
256 It is only possible to have one form in a PDF file!
264 \begin_layout Standard
265 If the form data should be submitted to a server or the like, then you must
266 specify the URL as parameter of the
279 This is done by using the menu
281 Insert\SpecialChar menuseparator
293 For example in this document the following was inserted to the parameter
297 \begin_layout Standard
300 action=mailto:forms@lyx.test?subject=The submitted PDF form,
301 \begin_inset Newline newline
307 \begin_layout Standard
308 This sends the form data as email to
312 when the user presses the submit button.
313 The email subject will be
314 \begin_inset Quotes eld
317 The submitted PDF form
318 \begin_inset Quotes erd
321 and the HTML method is
326 (The other possible method would be
330 .) For more about submitting see sec.
331 \begin_inset space \thinspace{}
335 \begin_inset CommandInset ref
337 reference "subsec:Submit-button"
344 \begin_layout Standard
345 \begin_inset Newpage newpage
351 \begin_layout Section
355 \begin_layout Standard
360 possible types of fields in a PDF form:
363 \begin_layout Subsection
367 \begin_layout Standard
368 A text field is added by inserting the custom inset
374 Insert\SpecialChar menuseparator
382 Write inside the inset the label for the text field that will be printed
383 in the PDF output before the field.
385 \begin_inset Newline newline
389 \begin_inset Flex TextField
392 \begin_layout Plain Layout
393 \begin_inset Argument 1
396 \begin_layout Plain Layout
402 Enter your name here:
410 \begin_layout Standard
411 You must also specify a field name for text fields: Set the cursor into
417 There insert for example the parameter
428 \begin_layout Standard
429 Using the same name for several text fields results in an automatic duplication
430 of the inserted text.
431 This is for example useful if the user should input a date that should
432 appear at different places in the form.
433 \begin_inset Newline newline
440 fields as example: Fill one and see that the other one will also be filled
442 \begin_inset Newline newline
446 \begin_inset Flex TextField
449 \begin_layout Plain Layout
450 \begin_inset Argument 1
453 \begin_layout Plain Layout
465 \begin_inset Newline newline
469 \begin_inset Flex TextField
472 \begin_layout Plain Layout
473 \begin_inset Argument 1
476 \begin_layout Plain Layout
490 \begin_layout Standard
491 All form fields can be customized by adding parameters.
494 \begin_layout Standard
495 Here is a customized multiline text field with a width of 60
496 \begin_inset space \thinspace{}
499 % of the text width, 3
500 \begin_inset space \thinspace{}
503 cm height and a proposed content:
504 \begin_inset VSpace defskip
508 \begin_inset Newline newline
512 \begin_inset Flex TextField
515 \begin_layout Plain Layout
516 \begin_inset Argument 1
519 \begin_layout Plain Layout
520 name=customer2, multiline, width=0.6
522 textwidth, height=3cm, value={Testman}
527 Enter your name here:
535 \begin_layout Standard
536 \begin_inset Note Greyedout
539 \begin_layout Plain Layout
544 It is highly recommended to use a uniform layout of all fields in your
547 \begin_inset space \thinspace{}
551 \begin_inset CommandInset ref
553 reference "sec:Form-field-customization"
557 for how this is done.
565 \begin_layout Subsection
569 \begin_layout Standard
570 A check box is added by inserting the custom inset
575 Write inside the inset the label for the box.
577 \begin_inset Newline newline
581 \begin_inset Flex CheckBox
584 \begin_layout Plain Layout
585 \begin_inset Argument 1
588 \begin_layout Plain Layout
594 Are you older than 18 years?
602 \begin_layout Standard
603 You must also specify a field name for check boxes: Insert for example the
612 is the field name) into the
619 \begin_layout Subsection
623 \begin_layout Standard
624 A choice menu is added by inserting the custom inset
629 A label for the inset is added by using the menu
631 Insert\SpecialChar menuseparator
635 Insert the label text into this inset.
636 \begin_inset Newline newline
639 The different choices are inserted to the inset as comma-separated list.
647 \begin_layout Description
648 Radio Only one choice can be selected
651 \begin_layout Description
652 Combo The choices are listed in a combo box (dropdown list) but the user
653 is allowed to choose something that is not in the predefined list.
656 \begin_layout Description
657 Popdown All choices are listed below each other.
658 It the filed is not high enough a scroll bar is automatically added to
662 \begin_layout Standard
663 To determine the choice menu type, add the parameter
678 \begin_layout Standard
679 Here is an example for the radio type:
680 \begin_inset VSpace defskip
684 \begin_inset Newline newline
688 \begin_inset Flex ChoiceMenu
691 \begin_layout Plain Layout
692 \begin_inset Argument 1
695 \begin_layout Plain Layout
702 \begin_inset Argument 2
705 \begin_layout Plain Layout
719 \begin_layout Standard
720 Here is an example for the combo type:
721 \begin_inset VSpace defskip
725 \begin_inset Newline newline
729 \begin_inset Flex ChoiceMenu
732 \begin_layout Plain Layout
733 \begin_inset Argument 1
736 \begin_layout Plain Layout
742 Albania=Al, Armenia=Ar, Azerbaidschan=Az
743 \begin_inset Argument 2
746 \begin_layout Plain Layout
760 \begin_layout Standard
761 Here is an example for the popdown type:
762 \begin_inset VSpace defskip
766 \begin_inset Newline newline
770 \begin_inset Flex ChoiceMenu
773 \begin_layout Plain Layout
774 \begin_inset Argument 1
777 \begin_layout Plain Layout
778 popdown, name=country
783 Albania=Al, Armenia=Ar, Azerbaidschan=Az
784 \begin_inset Argument 2
787 \begin_layout Plain Layout
801 \begin_layout Standard
802 You must also specify a field name for choice menus: Insert for example
811 is the field name) into the
818 \begin_layout Standard
819 It is recommended to add a short name for every choice to be able to access
820 them and to know which one was chosen by the user.
821 This is done by adding
825 behind each choice (where
830 For example the radio type example contains this choice list:
836 \begin_inset Quotes eld
840 \begin_inset Quotes erd
843 you know that he chose the choice
844 \begin_inset Quotes eld
848 \begin_inset Quotes erd
852 By specifying names you can also preset/propose e.g.
853 \begin_inset space \space{}
857 \begin_inset Quotes eld
861 \begin_inset Quotes erd
864 by adding the parameter
872 \begin_layout Standard
873 \begin_inset Flex ChoiceMenu
876 \begin_layout Plain Layout
877 \begin_inset Argument 1
880 \begin_layout Plain Layout
881 radio, name=sex, default=m
887 \begin_inset Argument 2
890 \begin_layout Plain Layout
904 \begin_layout Standard
905 \begin_inset Note Greyedout
908 \begin_layout Plain Layout
913 Due to a bug in the \SpecialChar LaTeX
918 it is currently only possible the set the first choice as default.
926 \begin_layout Standard
927 \begin_inset Newpage newpage
933 \begin_layout Subsection
937 \begin_layout Standard
938 A push button is added by inserting the custom inset
943 Write inside the inset the label for the button.
947 \begin_layout Standard
948 \begin_inset Flex PushButton
951 \begin_layout Plain Layout
952 \begin_inset Argument 1
955 \begin_layout Plain Layout
961 Don't click on this button or your fridge will be destroyed!!!
969 \begin_layout Standard
970 The action that is triggered by pressing the button is specified by JavaScript
972 To specify it, add the parameter
976 and insert the JavaScript code between the braces.
977 For info about JavaScript, see its documentation,
978 \begin_inset CommandInset citation
985 In the following example this JavaScript code was used:
986 \begin_inset Newline newline
995 \begin_layout Plain Layout
1002 What the hell? Now you destroyed your fridge.
1007 \begin_layout Plain Layout
1017 \begin_layout Standard
1018 \begin_inset Flex PushButton
1021 \begin_layout Plain Layout
1022 \begin_inset Argument 1
1025 \begin_layout Plain Layout
1030 \begin_layout Plain Layout
1037 What the hell? Now you destroyed your fridge.
1042 \begin_layout Plain Layout
1054 Don't click on this button or your fridge will be destroyed!!!
1062 \begin_layout Standard
1063 \begin_inset Note Greyedout
1066 \begin_layout Plain Layout
1071 All quote characters in form parameters must be inserted as \SpecialChar TeX
1080 \begin_layout Standard
1081 A common usage for pus buttons is to open a weblink.
1082 Such a button is created by inserting a hyperlink into the button inset.
1086 \begin_layout Standard
1087 \begin_inset Flex PushButton
1090 \begin_layout Plain Layout
1091 \begin_inset Argument 1
1094 \begin_layout Plain Layout
1101 \begin_inset CommandInset href
1103 name "Information how to fill out this form"
1104 target "http://wiki.lyx.org"
1116 \begin_layout Standard
1117 To get rid of the frame for weblinks add this to the additional options
1118 in the document settings under
1121 \begin_inset space ~
1129 \begin_layout Standard
1132 urlbordercolor={1 0 0}
1135 \begin_layout Standard
1136 if your push button border color is red (the default), otherwise use the
1137 same color definition as for your push button border color.
1140 \begin_layout Subsection
1142 \begin_inset CommandInset label
1144 name "subsec:Submit-button"
1151 \begin_layout Standard
1152 A submit button is used to submit the form data to a server.
1153 It is added by inserting the custom inset
1158 Write inside the inset the label for the button.
1162 \begin_layout Standard
1163 \begin_inset Flex SubmitButton
1166 \begin_layout Plain Layout
1167 \begin_inset Argument 1
1170 \begin_layout Plain Layout
1176 Send your data via email
1184 \begin_layout Standard
1185 The submit button creates a forms data format (FDF) file (file extension
1186 *.fdf) which is then submitted.
1187 The FDF file contains only the form data.
1188 They can only be applied to a PDF form if all fields in the form have a
1192 \begin_layout Standard
1193 \begin_inset Note Greyedout
1196 \begin_layout Plain Layout
1201 You can only use a submit button if you specified the submit method and
1202 target in the PDF form environment options! See sec.
1203 \begin_inset space \thinspace{}
1207 \begin_inset CommandInset ref
1209 reference "sec:Preparation"
1213 for the description.
1214 If there are no specifications you will get \SpecialChar LaTeX
1223 \begin_layout Standard
1224 \begin_inset Note Greyedout
1227 \begin_layout Plain Layout
1232 If you have more than one submit button in your document you must specify
1233 a name for each of them to avoid \SpecialChar LaTeX
1234 errors! For example add
1242 is the button name).
1250 \begin_layout Subsection
1254 \begin_layout Standard
1255 A reset button is used to reset all form fields to the initial state.
1256 It is added by inserting the custom inset
1261 Write inside the inset the label for the button.
1265 \begin_layout Standard
1266 \begin_inset Flex ResetButton
1269 \begin_layout Plain Layout
1270 \begin_inset Argument 1
1273 \begin_layout Plain Layout
1287 \begin_layout Standard
1288 \begin_inset Note Greyedout
1291 \begin_layout Plain Layout
1296 If you have more than one reset button in your document you must specify
1297 a name for each of them to avoid \SpecialChar LaTeX
1298 errors! For example add
1306 is the button name).
1314 \begin_layout Section
1315 Form field customization
1316 \begin_inset CommandInset label
1318 name "sec:Form-field-customization"
1325 \begin_layout Standard
1326 Since all form elements should look uniform, one can determine their layout
1327 using the following styles:
1330 \begin_layout Description
1332 \begin_inset space ~
1336 \begin_inset space ~
1342 \begin_layout Description
1344 \begin_inset space ~
1348 \begin_inset space ~
1354 \begin_layout Description
1356 \begin_inset space ~
1360 \begin_inset space ~
1363 Style affects all choice menu types
1366 \begin_layout Description
1368 \begin_inset space ~
1372 \begin_inset space ~
1375 Style affects only the combo box style
1378 \begin_layout Description
1380 \begin_inset space ~
1384 \begin_inset space ~
1387 Style affects only the popdown box style
1390 \begin_layout Description
1392 \begin_inset space ~
1396 \begin_inset space ~
1399 Style affects only the radio box style
1402 \begin_layout Description
1404 \begin_inset space ~
1408 \begin_inset space ~
1414 \begin_layout Description
1416 \begin_inset space ~
1420 \begin_inset space ~
1426 \begin_layout Description
1428 \begin_inset space ~
1432 \begin_inset space ~
1438 \begin_layout Text Field Style
1442 \begin_layout Standard
1443 The content of the styles is a comma-separated list of parameters.
1444 The possible parameters are listed in sec.
1445 \begin_inset space \thinspace{}
1449 \begin_inset Quotes eld
1452 Forms optional parameters
1453 \begin_inset Quotes erd
1456 of the documentation of the \SpecialChar LaTeX
1462 \begin_inset CommandInset citation
1469 It is important that the parameter print is always part of the definition,
1470 otherwise the fields won't appear in the PDF output.
1471 The defined style is applied to all fields following the definition.
1474 \begin_layout Subsubsection*
1475 Here are some examples:
1478 \begin_layout Text Field Style
1480 print, bordercolor=red, borderstyle=U, backgroundcolor=lightgray, color=lime,
1481 maxlen=10, align=2, charsize=16pt
1484 \begin_layout Check Box Style
1486 print, borderstyle=S, checkboxsymbol=
1491 \begin_layout Combo Box Style
1493 print, bordercolor={0.33 0.66 0.33}, borderstyle=D
1496 \begin_layout Popdown Box Style
1501 \begin_layout Radio Box Style
1503 print, borderstyle=I, radiosymbol=6
1506 \begin_layout Push Button Style
1508 print, borderstyle=B, bordercolor=lime
1511 \begin_layout Submit Button Style
1513 print, borderwidth=0, bordercolor=white
1516 \begin_layout Reset Button Style
1518 print, bordercolor=lime
1521 \begin_layout Itemize
1522 Text field with gray background, lime text color, a red border only below
1523 the field, right alignment, 16
1524 \begin_inset space \thinspace{}
1527 pt font size and a limitation for maximal 10
1528 \begin_inset space ~
1531 characters to insert:
1532 \begin_inset VSpace defskip
1536 \begin_inset Newline newline
1540 \begin_inset Flex TextField
1543 \begin_layout Plain Layout
1544 \begin_inset Argument 1
1547 \begin_layout Plain Layout
1553 Enter your name here:
1561 \begin_layout Standard
1589 \begin_layout Standard
1590 \begin_inset Note Greyedout
1593 \begin_layout Plain Layout
1602 has only an effect for text fields if a
1614 \begin_layout Itemize
1615 Check box with normal border and symbol
1618 \begin_inset VSpace defskip
1622 \begin_inset Newline newline
1626 \begin_inset Flex CheckBox
1629 \begin_layout Plain Layout
1630 \begin_inset Argument 1
1633 \begin_layout Plain Layout
1639 Are you older than 18 years?
1647 \begin_layout Standard
1648 The symbol is either specified as number or with the command
1649 \begin_inset Newline newline
1659 \begin_inset Newline newline
1666 is one of the possible numbers listed in Table
1667 \begin_inset space ~
1671 \begin_inset CommandInset citation
1680 \begin_layout Itemize
1681 Combo box with dashed, colored border:
1682 \begin_inset VSpace defskip
1686 \begin_inset Newline newline
1690 \begin_inset Flex ChoiceMenu
1693 \begin_layout Plain Layout
1694 \begin_inset Argument 1
1697 \begin_layout Plain Layout
1698 combo, name=combo2, default=Az
1703 Albania=Al, Armenia=Ar, Azerbaidschan=Az
1704 \begin_inset Argument 2
1707 \begin_layout Plain Layout
1721 \begin_layout Itemize
1722 Popdown box where only 2
1723 \begin_inset space ~
1726 entries are shown and where the last entry is preselected:
1727 \begin_inset VSpace defskip
1731 \begin_inset Newline newline
1735 \begin_inset Flex ChoiceMenu
1738 \begin_layout Plain Layout
1739 \begin_inset Argument 1
1742 \begin_layout Plain Layout
1743 popdown, name=country2, value=Az
1748 Albania=Al, Armenia=Ar, Azerbaidschan=Az
1749 \begin_inset Argument 2
1752 \begin_layout Plain Layout
1766 \begin_layout Standard
1767 \begin_inset VSpace defskip
1771 \begin_inset Note Greyedout
1774 \begin_layout Plain Layout
1791 has no effect for popdown boxes.
1799 \begin_layout Itemize
1800 Radio box with inverted bevel border and symbol number
1801 \begin_inset space ~
1805 \begin_inset VSpace defskip
1809 \begin_inset Newline newline
1813 \begin_inset Flex ChoiceMenu
1816 \begin_layout Plain Layout
1817 \begin_inset Argument 1
1820 \begin_layout Plain Layout
1827 \begin_inset Argument 2
1830 \begin_layout Plain Layout
1844 \begin_layout Itemize
1845 Push button with a bevel border and colored text:
1846 \begin_inset VSpace defskip
1850 \begin_inset Newline newline
1854 \begin_inset Flex PushButton
1857 \begin_layout Plain Layout
1858 \begin_inset Argument 1
1861 \begin_layout Plain Layout
1866 \begin_layout Plain Layout
1873 Why do you click this?
1877 \begin_layout Plain Layout
1890 \begin_inset Box Frameless
1900 height_special "totalheight"
1905 backgroundcolor "lime"
1908 \begin_layout Plain Layout
1911 Don't click on this button!!!
1924 \begin_layout Standard
1925 \begin_inset VSpace defskip
1929 \begin_inset Note Greyedout
1932 \begin_layout Plain Layout
1945 has no effect for push, submit and reset buttons.
1953 \begin_layout Standard
1954 As workaround use a colored box and/or color the box text.
1957 \begin_layout Standard
1958 \begin_inset Note Greyedout
1961 \begin_layout Plain Layout
1974 has no effect for push, submit and reset buttons.
1982 \begin_layout Standard
1983 As workaround a box.
1986 \begin_layout Itemize
1987 Submit button without border, with cyan background color and increased height:
1988 \begin_inset VSpace defskip
1992 \begin_inset Newline newline
1996 \begin_inset Flex SubmitButton
1999 \begin_layout Plain Layout
2000 \begin_inset Argument 1
2003 \begin_layout Plain Layout
2010 \begin_inset Box Frameless
2020 height_special "totalheight"
2025 backgroundcolor "cyan"
2028 \begin_layout Plain Layout
2029 Send your data via mail
2040 \begin_inset VSpace bigskip
2046 \begin_layout Itemize
2047 Reset button with a width of 7
2048 \begin_inset space \thinspace{}
2052 \begin_inset VSpace defskip
2056 \begin_inset Newline newline
2060 \begin_inset Flex ResetButton
2063 \begin_layout Plain Layout
2064 \begin_inset Argument 1
2067 \begin_layout Plain Layout
2074 \begin_inset Box Frameless
2084 height_special "totalheight"
2089 backgroundcolor "none"
2092 \begin_layout Plain Layout
2106 \begin_layout Section
2107 PDF viewer action buttons
2110 \begin_layout Standard
2111 One often needs basic actions to be done by the PDF viewer program.
2112 For example to print the form.
2113 Such PDF program-specific actions can be triggered by adding inserting
2119 The PDF viewer programs
2127 can handle all possible actions while other PDF viewers might only support
2129 However, all PDF viewer programs support the basic things like printing,
2131 \begin_inset space ~
2134 as, view in fullscreen etc..
2137 \begin_layout Standard
2138 To specify the action insert its name to the
2143 A list with possible actions can be found in sec.
2144 \begin_inset space \thinspace{}
2148 \begin_inset Quotes eld
2151 Acrobat-specific behavior
2152 \begin_inset Quotes erd
2155 of the documentation of the \SpecialChar LaTeX
2161 \begin_inset CommandInset citation
2170 \begin_layout Standard
2171 Here are some examples:
2174 \begin_layout Description
2176 \begin_inset Flex PDFAction
2179 \begin_layout Plain Layout
2180 \begin_inset Argument 1
2183 \begin_layout Plain Layout
2197 \begin_layout Description
2199 \begin_inset space ~
2203 \begin_inset Flex PDFAction
2206 \begin_layout Plain Layout
2207 \begin_inset Argument 1
2210 \begin_layout Plain Layout
2224 \begin_layout Description
2226 \begin_inset space ~
2230 \begin_inset space ~
2234 \begin_inset Flex PDFAction
2237 \begin_layout Plain Layout
2238 \begin_inset Argument 1
2241 \begin_layout Plain Layout
2247 View the form in fullscreen
2255 \begin_layout Subsection
2256 Action button customization
2257 \begin_inset CommandInset label
2259 name "subsec:Action-button-customization"
2266 \begin_layout Standard
2267 Customizing the action buttons requires the usage of boxes because things
2268 like the width, height and border separation cannot be specified as button
2272 \begin_layout Standard
2273 The easiest way to customize the buttons is to fill it with a custom box.
2274 For example the button should be 4
2275 \begin_inset space \thinspace{}
2278 cm wide and have the height of 2 lines.
2279 Then create this parbox:
2282 \begin_layout Standard
2283 \begin_inset Box Frameless
2293 height_special "totalheight"
2298 backgroundcolor "none"
2301 \begin_layout Plain Layout
2311 \begin_layout Standard
2320 \begin_layout Standard
2321 \begin_inset Flex PDFAction
2324 \begin_layout Plain Layout
2325 \begin_inset Argument 1
2328 \begin_layout Plain Layout
2335 \begin_inset Box Frameless
2345 height_special "totalheight"
2350 backgroundcolor "none"
2353 \begin_layout Plain Layout
2367 \begin_layout Standard
2368 To customize the border color, add the command
2370 menubordercolor={r g b}
2372 to the additional options in the document settings under
2375 \begin_inset space ~
2392 with a number between 0 and 1 for the colors red, green and blue.
2393 If you want to change the border color only for certain buttons, use the
2397 \begin_inset space ~
2401 \begin_inset space ~
2406 before the button and insert there the command
2411 The default value of
2422 \begin_layout PDF Link Setup
2424 menubordercolor={0.1 0.9 0.5}
2427 \begin_layout Standard
2430 menubordercolor={0.1 0.9 0.5}
2433 \begin_inset Newline newline
2437 \begin_inset Flex PDFAction
2440 \begin_layout Plain Layout
2441 \begin_inset Argument 1
2444 \begin_layout Plain Layout
2451 \begin_inset Box Frameless
2461 height_special "totalheight"
2466 backgroundcolor "none"
2469 \begin_layout Plain Layout
2484 \begin_layout Standard
2485 To change the border width use the command
2493 is the width in pixels.
2494 The default value of
2505 \begin_layout Standard
2506 \begin_inset Note Greyedout
2509 \begin_layout Plain Layout
2518 affects all link types, not only the menu links.
2526 \begin_layout PDF Link Setup
2528 pdfborder={0 0 4}, menubordercolor={1 1 0}
2531 \begin_layout Standard
2533 \begin_inset space ~
2536 pixel thick yellow border:
2537 \begin_inset Newline newline
2541 \begin_inset Flex PDFAction
2544 \begin_layout Plain Layout
2545 \begin_inset Argument 1
2548 \begin_layout Plain Layout
2555 \begin_inset Box Frameless
2565 height_special "totalheight"
2570 backgroundcolor "none"
2573 \begin_layout Plain Layout
2588 \begin_layout Standard
2589 To change the background color use a colored box.
2592 \begin_layout PDF Link Setup
2597 \begin_layout Standard
2598 An example without a border and with lime background color:
2599 \begin_inset Newline newline
2603 \begin_inset Flex PDFAction
2606 \begin_layout Plain Layout
2607 \begin_inset Argument 1
2610 \begin_layout Plain Layout
2617 \begin_inset Box Frameless
2627 height_special "totalheight"
2632 backgroundcolor "lime"
2635 \begin_layout Plain Layout
2650 \begin_layout PDF Link Setup
2652 pdfborder={0 0 1}, menubordercolor={1 0 0}
2655 \begin_layout Section
2659 \begin_layout Standard
2660 It is also possible to have dynamic form fields.
2661 This means that depending on the actions of the user fields can (dis)appear
2662 or change their appearance.
2663 To use this feature, add these lines to your document preamble:
2666 \begin_layout Standard
2671 usepackage[pdftex]{insdljs}
2672 \begin_inset Newline newline
2686 \begin_layout Standard
2687 Then add the necessary JavaScript code to your document \SpecialChar LaTeX
2690 code to your document.
2691 For info about JavaScript, see its documentation,
2692 \begin_inset CommandInset citation
2701 \begin_layout Standard
2705 \begin_layout Plain Layout
2715 \begin_inset Note Note
2718 \begin_layout Plain Layout
2719 The following section will only be displayed when the \SpecialChar LaTeX
2732 \begin_layout Standard
2733 For the following choice menu this JavaScript code was used:
2736 \begin_layout Standard
2737 \begin_inset listings
2738 lstparams "language=TeX"
2742 \begin_layout Plain Layout
2746 begin{insDLJS}[exaaae]{exaaae}{JavaScript}
2749 \begin_layout Plain Layout
2751 function validateTime(){
2754 \begin_layout Plain Layout
2759 \begin_layout Plain Layout
2761 if((event.value == "u") || (event.value == "unlimited")) {
2764 \begin_layout Plain Layout
2766 this.getField("from").display = display.hidden;
2769 \begin_layout Plain Layout
2771 this.getField("to").display = display.hidden;
2774 \begin_layout Plain Layout
2779 \begin_layout Plain Layout
2781 this.getField("from").display = display.visible;
2784 \begin_layout Plain Layout
2786 this.getField("to").display = display.visible;
2789 \begin_layout Plain Layout
2791 this.getField("from").setFocus();
2794 \begin_layout Plain Layout
2799 \begin_layout Plain Layout
2804 \begin_layout Plain Layout
2809 \begin_layout Plain Layout
2821 \begin_layout Standard
2822 \begin_inset Note Greyedout
2825 \begin_layout Plain Layout
2834 JavaScript funtions must be inserted into the same
2846 \begin_layout Standard
2850 \begin_inset space ~
2854 \begin_inset space ~
2859 of the following choice menu are
2860 \begin_inset Newline newline
2865 name=contract,radio,default=tl,validate={validateTime();}
2868 \begin_layout Standard
2869 \begin_inset Flex ChoiceMenu
2872 \begin_layout Plain Layout
2873 \begin_inset Argument 1
2876 \begin_layout Plain Layout
2877 name=contract,radio,default=tl,validate={validateTime();}
2882 term-limited=tl, unlimited=u
2883 \begin_inset Argument 2
2886 \begin_layout Plain Layout
2898 \begin_inset VSpace defskip
2904 \begin_layout Standard
2905 \begin_inset Tabular
2906 <lyxtabular version="3" rows="3" columns="2">
2907 <features tabularvalignment="middle">
2908 <column alignment="left" valignment="top">
2909 <column alignment="center" valignment="top">
2911 <cell alignment="left" valignment="top" usebox="none">
2914 \begin_layout Plain Layout
2920 <cell alignment="center" valignment="top" usebox="none">
2923 \begin_layout Plain Layout
2924 \begin_inset Flex TextField
2927 \begin_layout Plain Layout
2928 \begin_inset Argument 1
2931 \begin_layout Plain Layout
2932 name=from,width=10em
2949 <cell alignment="center" valignment="top" usebox="none">
2952 \begin_layout Plain Layout
2958 <cell alignment="center" valignment="top" usebox="none">
2961 \begin_layout Plain Layout
2962 \begin_inset VSpace -1.5mm
2972 <cell alignment="left" valignment="top" usebox="none">
2975 \begin_layout Plain Layout
2981 <cell alignment="center" valignment="top" usebox="none">
2984 \begin_layout Plain Layout
2985 \begin_inset Flex TextField
2988 \begin_layout Plain Layout
2989 \begin_inset Argument 1
2992 \begin_layout Plain Layout
3016 \begin_layout Standard
3017 \begin_inset VSpace bigskip
3023 \begin_layout Standard
3024 To check and assure that the user only enters a number to a text field you
3025 can for example use this JavaScript code:
3028 \begin_layout Standard
3029 \begin_inset listings
3030 lstparams "language=TeX"
3034 \begin_layout Plain Layout
3036 function checkNumber() {
3039 \begin_layout Plain Layout
3044 \begin_layout Plain Layout
3046 if (!Number(event.value)) {
3049 \begin_layout Plain Layout
3051 app.alert("Value must be a number!");
3054 \begin_layout Plain Layout
3059 \begin_layout Plain Layout
3064 \begin_layout Plain Layout
3066 event.target.textColor = color.green;
3069 \begin_layout Plain Layout
3079 \begin_layout Standard
3080 An example text field:
3081 \begin_inset Flex TextField
3084 \begin_layout Plain Layout
3085 \begin_inset Argument 1
3088 \begin_layout Plain Layout
3089 name=onlyNumbers, align=1, validate={checkNumber();}
3102 \begin_layout Standard
3106 \begin_layout Plain Layout
3116 \begin_inset Note Note
3119 \begin_layout Plain Layout
3120 The following will be displayed when the \SpecialChar LaTeX
3133 \begin_layout Standard
3134 You need to install the package
3138 to see the content of this section in the output.
3141 \begin_layout Standard
3145 \begin_layout Plain Layout
3157 \begin_layout End PDF Form
3159 \begin_inset Note Note
3162 \begin_layout Plain Layout
3171 \begin_layout Section
3172 General notes and hints
3175 \begin_layout Itemize
3176 Submitting and applying data requires that all form fields have a name.
3179 \begin_layout Itemize
3180 All braces, brackets, backslashes and quote characters in form parameters
3181 must be inserted as \SpecialChar TeX
3185 \begin_layout Itemize
3186 It is not possible to create a PDF form using Xe\SpecialChar TeX
3188 Use either the \SpecialChar LyX
3195 PDF (Lua\SpecialChar TeX
3201 \begin_layout Itemize
3210 custom background colors you must disable in these programs to highlight
3211 the available form fields in the PDF.
3214 \begin_layout Bibliography
3215 \begin_inset CommandInset bibitem
3216 LatexCommand bibitem
3222 \begin_inset CommandInset href
3224 name "JavaScript reference"
3225 target "https://developer.mozilla.org/en/docs/Web/JavaScript/Reference"
3232 \begin_layout Bibliography
3233 \begin_inset CommandInset bibitem
3234 LatexCommand bibitem
3240 \begin_inset CommandInset href
3242 name "Documentation"
3243 target "http://mirrors.ctan.org/macros/latex/contrib/hyperref/doc/manual.pdf"
3247 of the \SpecialChar LaTeX
3253 \begin_layout Bibliography
3254 \begin_inset CommandInset bibitem
3255 LatexCommand bibitem
3261 \begin_inset CommandInset href
3263 name "Documentation"
3264 target "http://mirrors.ctan.org/macros/latex/required/psnfss/psnfss2e.pdf"
3268 of the \SpecialChar LaTeX