1 #LyX 2.2 created this file. For more info see http://www.lyx.org/
5 \save_transient_properties true
6 \origin /systemlyxdir/examples/
9 % used to check for needed LaTeX packages
12 % check for package insdljs
13 % used for JavScript code
15 \IfFileExists{insdljs.sty}
16 {\usepackage[pdftex]{insdljs}
17 \setboolean{insdljs}{true}
18 \pdfcatalog{/AA \the\pdflastobj\space 0 R}}
19 {\setboolean{insdljs}{false}}
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 pdf2
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 "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 elements will not 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 submit 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 elements 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 name for text fields.
412 To do this set the cursor into its
416 inset and insert the parameter
427 \begin_layout Standard
428 Using the same name for several text fields results in an automatic duplication
429 of the inserted text.
430 This is for example useful if the user should input a date that should
431 appear at different places in the form.
432 \begin_inset Newline newline
439 fields as example: Fill one and see that the other one will be filled automatica
440 lly when you click outside of the field:
441 \begin_inset Newline newline
445 \begin_inset Flex TextField
448 \begin_layout Plain Layout
449 \begin_inset Argument 1
452 \begin_layout Plain Layout
464 \begin_inset Newline newline
468 \begin_inset Flex TextField
471 \begin_layout Plain Layout
472 \begin_inset Argument 1
475 \begin_layout Plain Layout
489 \begin_layout Standard
490 \begin_inset Note Greyedout
493 \begin_layout Plain Layout
498 Special characters should be avoided in element names.
506 \begin_layout Standard
507 All form fields can be customized by adding parameters.
510 \begin_layout Standard
511 Here is a customized multiline text field with a width of 60
512 \begin_inset space \thinspace{}
515 % of the text width, 3
516 \begin_inset space \thinspace{}
519 cm height and a proposed content:
520 \begin_inset VSpace defskip
524 \begin_inset Newline newline
528 \begin_inset Flex TextField
531 \begin_layout Plain Layout
532 \begin_inset Argument 1
535 \begin_layout Plain Layout
536 name=customer2, multiline, width=0.6
538 textwidth, height=3cm, value={proposed text}
543 Enter your name here:
551 \begin_layout Standard
552 \begin_inset Note Greyedout
555 \begin_layout Plain Layout
560 It is highly recommended to use a uniform layout of all fields in a form.
562 \begin_inset space \thinspace{}
566 \begin_inset CommandInset ref
568 reference "sec:Form-element-customization"
580 \begin_layout Subsection
584 \begin_layout Standard
585 A check box is added by inserting the custom inset
590 Write inside the inset the label for the box.
592 \begin_inset Newline newline
596 \begin_inset Flex CheckBox
599 \begin_layout Plain Layout
600 \begin_inset Argument 1
603 \begin_layout Plain Layout
609 Are you older than 18 years?
617 \begin_layout Standard
618 You must specify also for check boxes a name.
620 \begin_inset space \thinspace{}
624 \begin_inset space \space{}
635 is the name) into the
642 \begin_layout Subsection
646 \begin_layout Standard
647 A choice menu is added by inserting the custom inset
652 A label for the inset is added by using the menu
654 Insert\SpecialChar menuseparator
658 The different choices are inserted to the inset as comma-separated list.
666 \begin_layout Description
667 Radio Only one choice can be selected
670 \begin_layout Description
671 Combo The choices are listed in a combo box (dropdown list) but the user
672 is allowed to input something that is not in the predefined list.
675 \begin_layout Description
676 Popdown All choices are listed below each other.
677 If the menu is not high enough a scroll bar is automatically added.
680 \begin_layout Standard
681 To determine the choice menu type one uses the parameter
696 \begin_layout Standard
697 Here is an example for the radio type:
698 \begin_inset VSpace defskip
702 \begin_inset Newline newline
706 \begin_inset Flex ChoiceMenu
709 \begin_layout Plain Layout
710 \begin_inset Argument 1
713 \begin_layout Plain Layout
720 \begin_inset Argument 2
723 \begin_layout Plain Layout
737 \begin_layout Standard
738 Here is an example for the combo type:
739 \begin_inset VSpace defskip
743 \begin_inset Newline newline
747 \begin_inset Flex ChoiceMenu
750 \begin_layout Plain Layout
751 \begin_inset Argument 1
754 \begin_layout Plain Layout
760 Albania=Al, Armenia=Ar, Azerbaidschan=Az
761 \begin_inset Argument 2
764 \begin_layout Plain Layout
778 \begin_layout Standard
779 Here is an example for the popdown type:
780 \begin_inset VSpace defskip
784 \begin_inset Newline newline
788 \begin_inset Flex ChoiceMenu
791 \begin_layout Plain Layout
792 \begin_inset Argument 1
795 \begin_layout Plain Layout
796 popdown, name=country
801 Albania=Al, Armenia=Ar, Azerbaidschan=Az
802 \begin_inset Argument 2
805 \begin_layout Plain Layout
819 \begin_layout Standard
820 You must also specify a name for choice menus.
821 Insert for example the parameter
829 is the name) into the
836 \begin_layout Standard
837 It is recommended to add a short name for every choice to be able to access
838 them and to know which one was chosen by the user.
839 This is done by adding
843 behind each choice (where
848 For example the radio type example contains this choice list:
854 \begin_inset Quotes eld
858 \begin_inset Quotes erd
861 you know that he chose the choice
862 \begin_inset Quotes eld
866 \begin_inset Quotes erd
870 With the name you can also preset/propose e.g.
871 \begin_inset space \space{}
875 \begin_inset Quotes eld
879 \begin_inset Quotes erd
882 by adding the parameter
890 \begin_layout Standard
891 \begin_inset Flex ChoiceMenu
894 \begin_layout Plain Layout
895 \begin_inset Argument 1
898 \begin_layout Plain Layout
899 radio, name=sex, default=m
905 \begin_inset Argument 2
908 \begin_layout Plain Layout
922 \begin_layout Subsection
926 \begin_layout Standard
927 A push button is added by inserting the custom inset
932 Write inside the inset the label for the button.
936 \begin_layout Standard
937 \begin_inset Flex PushButton
940 \begin_layout Plain Layout
941 \begin_inset Argument 1
944 \begin_layout Plain Layout
950 Don't click on this button or your fridge will be destroyed!!!
958 \begin_layout Standard
959 The action that is triggered by pressing the button is specified by JavaScript
961 To do this, add the parameter
965 and insert the JavaScript code between the braces.
966 For info about JavaScript, see its documentation,
967 \begin_inset CommandInset citation
974 In the following example this JavaScript code was used:
975 \begin_inset Newline newline
984 \begin_layout Plain Layout
991 What the hell? Now you destroyed your fridge.
993 \begin_inset Quotes eld
997 \begin_inset Quotes erd
1004 \begin_layout Plain Layout
1014 \begin_layout Standard
1015 \begin_inset Flex PushButton
1018 \begin_layout Plain Layout
1019 \begin_inset Argument 1
1022 \begin_layout Plain Layout
1027 \begin_layout Plain Layout
1034 What the hell? Now you destroyed your fridge.
1036 \begin_inset Quotes eld
1040 \begin_inset Quotes erd
1047 \begin_layout Plain Layout
1059 Don't click on this button or your fridge will be destroyed!!!
1067 \begin_layout Standard
1068 \begin_inset Note Greyedout
1071 \begin_layout Plain Layout
1076 The outer quotes are part of the JavaScript code and must therefore be
1077 inserted as \SpecialChar TeX
1086 \begin_layout Standard
1087 A common usage for push buttons is to open a weblink.
1088 Such a button is created by inserting a hyperlink as button text.
1092 \begin_layout Standard
1093 \begin_inset Flex PushButton
1096 \begin_layout Plain Layout
1097 \begin_inset Argument 1
1100 \begin_layout Plain Layout
1107 \begin_inset CommandInset href
1109 name "Information how to fill out this form"
1110 target "http://wiki.lyx.org"
1122 \begin_layout Standard
1123 To get rid of the predefined frame for weblinks add this to the additional
1124 options in the document settings under
1127 \begin_inset space ~
1135 \begin_layout Standard
1138 urlbordercolor={1 0 0}
1141 \begin_layout Standard
1142 if your push button border color is red (the default), otherwise use the
1143 same color definition as for your push button border color.
1146 \begin_layout Subsection
1148 \begin_inset CommandInset label
1150 name "subsec:Submit-button"
1157 \begin_layout Standard
1158 A submit button is used to submit the form data to a server.
1159 It is added by inserting the custom inset
1164 The label for the button is written into the inset.
1168 \begin_layout Standard
1169 \begin_inset Flex SubmitButton
1172 \begin_layout Plain Layout
1173 \begin_inset Argument 1
1176 \begin_layout Plain Layout
1182 Send your data via email
1190 \begin_layout Standard
1191 The submit button creates a forms data format (FDF) file (file extension
1192 *.fdf) which is then submitted.
1193 The FDF file contains only the form data.
1194 They can later only be applied to a PDF form if all elements in the form
1198 \begin_layout Standard
1199 \begin_inset Note Greyedout
1202 \begin_layout Plain Layout
1207 You can only use a submit button if you specified the submit method and
1208 a target in the inset
1211 \begin_inset space ~
1215 \begin_inset space ~
1221 \begin_inset space \thinspace{}
1225 \begin_inset CommandInset ref
1227 reference "sec:Preparation"
1231 for the description.
1232 If there are no specifications you will get \SpecialChar LaTeX
1241 \begin_layout Subsection
1245 \begin_layout Standard
1246 A reset button is used to reset all form elements to the initial state.
1247 It is added by inserting the custom inset
1252 The label for the button is written into the inset.
1256 \begin_layout Standard
1257 \begin_inset Flex ResetButton
1260 \begin_layout Plain Layout
1261 \begin_inset Argument 1
1264 \begin_layout Plain Layout
1278 \begin_layout Section
1279 Form element customization
1280 \begin_inset CommandInset label
1282 name "sec:Form-element-customization"
1289 \begin_layout Standard
1290 Since all form elements should look uniform, one can determine their layout
1291 using the following styles:
1294 \begin_layout Description
1296 \begin_inset space ~
1300 \begin_inset space ~
1306 \begin_layout Description
1308 \begin_inset space ~
1312 \begin_inset space ~
1318 \begin_layout Description
1320 \begin_inset space ~
1324 \begin_inset space ~
1327 Style affects all choice menu types
1330 \begin_layout Description
1332 \begin_inset space ~
1336 \begin_inset space ~
1339 Style affects only the combo box style
1342 \begin_layout Description
1344 \begin_inset space ~
1348 \begin_inset space ~
1351 Style affects only the popdown box style
1354 \begin_layout Description
1356 \begin_inset space ~
1360 \begin_inset space ~
1363 Style affects only the radio box style
1366 \begin_layout Description
1368 \begin_inset space ~
1372 \begin_inset space ~
1378 \begin_layout Description
1380 \begin_inset space ~
1384 \begin_inset space ~
1390 \begin_layout Description
1392 \begin_inset space ~
1396 \begin_inset space ~
1402 \begin_layout Standard
1403 The content of the styles is a comma-separated list of parameters.
1404 The possible parameters are listed in sec.
1405 \begin_inset space \thinspace{}
1409 \begin_inset Quotes eld
1412 Forms optional parameters
1413 \begin_inset Quotes erd
1416 of the documentation of the \SpecialChar LaTeX
1422 \begin_inset CommandInset citation
1429 It is important that the parameter
1433 is always part of the definition.
1434 Otherwise the elements will not appear in the PDF.
1435 The defined style is applied to all elements following the definition.
1438 \begin_layout Subsubsection*
1439 Here are some examples:
1442 \begin_layout Text Field Style
1444 print, bordercolor=red, borderstyle=U, backgroundcolor=lightgray, color=lime,
1445 maxlen=10, align=2, charsize=16pt
1446 \begin_inset Note Note
1449 \begin_layout Plain Layout
1482 \begin_layout Check Box Style
1484 print, borderstyle=S, checkboxsymbol=
1489 \begin_layout Combo Box Style
1491 print, bordercolor={0.33 0.66 0.33}, borderstyle=D
1494 \begin_layout Popdown Box Style
1497 \begin_inset Note Note
1500 \begin_layout Plain Layout
1505 determines the number of displayed menu entries.
1506 It does not work currently because of a bug in the \SpecialChar LaTeX
1519 \begin_layout Radio Box Style
1521 print, borderstyle=I, radiosymbol=3
1524 \begin_layout Push Button Style
1526 print, borderstyle=B, bordercolor=lime
1529 \begin_layout Submit Button Style
1531 print, borderwidth=0, bordercolor=white
1534 \begin_layout Reset Button Style
1536 print, bordercolor=lime
1539 \begin_layout Itemize
1540 Text field with gray background, lime text color, a red border only below
1541 the field, right alignment, 16
1542 \begin_inset space \thinspace{}
1545 pt font size and a limitation for maximal 10
1546 \begin_inset space ~
1549 characters to insert:
1550 \begin_inset VSpace defskip
1554 \begin_inset Newline newline
1558 \begin_inset Flex TextField
1561 \begin_layout Plain Layout
1562 \begin_inset Argument 1
1565 \begin_layout Plain Layout
1571 Enter your name here:
1579 \begin_layout Standard
1580 \begin_inset Note Greyedout
1583 \begin_layout Plain Layout
1596 custom background colors you must disable in these programs the highlighting
1599 \begin_inset Quotes eld
1602 Show border hover color for fields
1603 \begin_inset Quotes erd
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 ~
1670 2 of the documentation of the \SpecialChar LaTeX
1676 \begin_inset CommandInset citation
1685 \begin_layout Itemize
1686 Combo choice menu with dashed, colored border where the last entry is preselecte
1688 \begin_inset VSpace defskip
1692 \begin_inset Newline newline
1696 \begin_inset Flex ChoiceMenu
1699 \begin_layout Plain Layout
1700 \begin_inset Argument 1
1703 \begin_layout Plain Layout
1704 combo, name=combo2, default=Az
1709 Albania=Al, Armenia=Ar, Azerbaidschan=Az
1710 \begin_inset Argument 2
1713 \begin_layout Plain Layout
1727 \begin_layout Itemize
1728 Popdown choice menu where the second entry is preselected:
1729 \begin_inset VSpace defskip
1733 \begin_inset Newline newline
1737 \begin_inset Flex ChoiceMenu
1740 \begin_layout Plain Layout
1741 \begin_inset Argument 1
1744 \begin_layout Plain Layout
1745 popdown, name=country2, default=Ar
1750 Albania=Al, Armenia=Ar, Azerbaidschan=Az
1751 \begin_inset Argument 2
1754 \begin_layout Plain Layout
1768 \begin_layout Standard
1769 \begin_inset VSpace defskip
1773 \begin_inset Note Greyedout
1776 \begin_layout Plain Layout
1793 have no effect for popdown choice menus.
1801 \begin_layout Itemize
1802 Radio choice menu with inverted bevel border and symbol number
1803 \begin_inset space ~
1807 \begin_inset VSpace defskip
1811 \begin_inset Newline newline
1815 \begin_inset Flex ChoiceMenu
1818 \begin_layout Plain Layout
1819 \begin_inset Argument 1
1822 \begin_layout Plain Layout
1829 \begin_inset Argument 2
1832 \begin_layout Plain Layout
1846 \begin_layout Standard
1847 \begin_inset VSpace defskip
1851 \begin_inset Note Greyedout
1854 \begin_layout Plain Layout
1875 have no effect for push, submit and reset buttons.
1883 \begin_layout Standard
1884 As workaround use a colored box and/or color the box text.
1887 \begin_layout Itemize
1888 Push button with a bevel border and colored text:
1889 \begin_inset VSpace defskip
1893 \begin_inset Newline newline
1897 \begin_inset Flex PushButton
1900 \begin_layout Plain Layout
1901 \begin_inset Argument 1
1904 \begin_layout Plain Layout
1909 \begin_layout Plain Layout
1916 Why do you click this?
1920 \begin_layout Plain Layout
1933 \begin_inset Box Frameless
1943 height_special "totalheight"
1948 backgroundcolor "lime"
1951 \begin_layout Plain Layout
1954 Don't click on this button!!!
1965 \begin_inset VSpace bigskip
1971 \begin_layout Itemize
1972 Submit button without border, with cyan background and increased height:
1973 \begin_inset VSpace defskip
1977 \begin_inset Newline newline
1981 \begin_inset Flex SubmitButton
1984 \begin_layout Plain Layout
1985 \begin_inset Argument 1
1988 \begin_layout Plain Layout
1995 \begin_inset Box Frameless
2005 height_special "totalheight"
2010 backgroundcolor "cyan"
2013 \begin_layout Plain Layout
2014 \begin_inset Box Frameless
2024 height_special "totalheight"
2029 backgroundcolor "none"
2032 \begin_layout Plain Layout
2033 Send your data via mail
2049 \begin_inset VSpace bigskip
2055 \begin_layout Itemize
2056 Reset button with a width of 7
2057 \begin_inset space \thinspace{}
2061 \begin_inset VSpace defskip
2065 \begin_inset Newline newline
2069 \begin_inset Flex ResetButton
2072 \begin_layout Plain Layout
2073 \begin_inset Argument 1
2076 \begin_layout Plain Layout
2083 \begin_inset Box Frameless
2093 height_special "totalheight"
2098 backgroundcolor "none"
2101 \begin_layout Plain Layout
2115 \begin_layout Standard
2116 \begin_inset Newpage newpage
2122 \begin_layout Section
2126 \begin_layout Standard
2127 One often needs basic actions to be done by the PDF viewer program, for
2128 example to print the form.
2129 Such PDF program-specific actions can be triggered by adding inserting
2143 can handle all possible actions while other PDF viewers might only support
2145 However, all PDF viewers support the basic things like printing, save
2146 \begin_inset space ~
2149 as, view in fullscreen etc..
2152 \begin_layout Standard
2153 To specify the action insert its name to the
2158 A list with possible action names can be found in sec.
2159 \begin_inset space \thinspace{}
2163 \begin_inset Quotes eld
2166 Acrobat-specific behavior
2167 \begin_inset Quotes erd
2170 of the documentation of the \SpecialChar LaTeX
2176 \begin_inset CommandInset citation
2185 \begin_layout Standard
2186 Here are some examples:
2189 \begin_layout Description
2191 \begin_inset Flex PDFAction
2194 \begin_layout Plain Layout
2195 \begin_inset Argument 1
2198 \begin_layout Plain Layout
2212 \begin_layout Description
2214 \begin_inset space ~
2218 \begin_inset Flex PDFAction
2221 \begin_layout Plain Layout
2222 \begin_inset Argument 1
2225 \begin_layout Plain Layout
2239 \begin_layout Description
2241 \begin_inset space ~
2245 \begin_inset space ~
2249 \begin_inset Flex PDFAction
2252 \begin_layout Plain Layout
2253 \begin_inset Argument 1
2256 \begin_layout Plain Layout
2262 View the form in fullscreen
2270 \begin_layout Subsection
2271 Action button customization
2272 \begin_inset CommandInset label
2274 name "subsec:Action-button-customization"
2281 \begin_layout Standard
2282 Customizing the action buttons requires the usage of boxes because things
2283 like the width, height and border separation cannot be specified as button
2287 \begin_layout Standard
2288 The easiest way to customize the buttons is to fill it with a custom box.
2289 For example the button should be 5
2290 \begin_inset space \thinspace{}
2293 cm wide and have the height of 2
2294 \begin_inset space ~
2298 Then create this parbox:
2301 \begin_layout Standard
2302 \begin_inset Box Frameless
2312 height_special "totalheight"
2317 backgroundcolor "none"
2320 \begin_layout Plain Layout
2330 \begin_layout Standard
2339 \begin_layout Standard
2340 \begin_inset Flex PDFAction
2343 \begin_layout Plain Layout
2344 \begin_inset Argument 1
2347 \begin_layout Plain Layout
2354 \begin_inset Box Frameless
2364 height_special "totalheight"
2369 backgroundcolor "none"
2372 \begin_layout Plain Layout
2386 \begin_layout PDF Link Setup
2389 \begin_inset Note Note
2392 \begin_layout Plain Layout
2393 Sets the thickness of the predefined link border to zero as described below.
2401 \begin_layout Standard
2402 To customize the border color, border thickness and the distance to the
2403 border one changes the border settings of the box.
2405 \begin_inset space \thinspace{}
2408 pt thick, teal border and 3
2409 \begin_inset space \thinspace{}
2412 pt border separation :
2413 \begin_inset VSpace defskip
2417 \begin_inset Newline newline
2421 \begin_inset Flex PDFAction
2424 \begin_layout Plain Layout
2425 \begin_inset Argument 1
2428 \begin_layout Plain Layout
2435 \begin_inset Box Boxed
2445 height_special "totalheight"
2450 backgroundcolor "white"
2453 \begin_layout Plain Layout
2468 \begin_layout Standard
2469 To customize the border thickness, add the command
2473 to the additional options in the document settings under
2476 \begin_inset space ~
2485 with a number that is the thickness in pixels.
2486 If you want to change the border thickness only for certain buttons, use
2490 \begin_inset space ~
2494 \begin_inset space ~
2499 before the button and insert there the command
2504 The default value of
2515 \begin_layout Standard
2516 \begin_inset Note Greyedout
2519 \begin_layout Plain Layout
2528 affects all link types, not only the action links.
2536 \begin_layout PDF Link Setup
2541 \begin_layout Standard
2543 \begin_inset space ~
2547 \begin_inset Newline newline
2551 \begin_inset Flex PDFAction
2554 \begin_layout Plain Layout
2555 \begin_inset Argument 1
2558 \begin_layout Plain Layout
2565 \begin_inset Box Frameless
2575 height_special "totalheight"
2580 backgroundcolor "none"
2583 \begin_layout Plain Layout
2598 \begin_layout Standard
2599 To change the border color use the command
2601 menubordercolor={r g b}
2615 are numbers between 0 and 1 for the colors red, green and blue.
2616 The default value of
2627 \begin_layout PDF Link Setup
2629 pdfborder={0 0 1}, menubordercolor={0.1 0.9 0.5}
2632 \begin_layout Standard
2635 menubordercolor={0.1 0.9 0.5}
2638 \begin_inset Newline newline
2642 \begin_inset Flex PDFAction
2645 \begin_layout Plain Layout
2646 \begin_inset Argument 1
2649 \begin_layout Plain Layout
2656 \begin_inset Box Frameless
2666 height_special "totalheight"
2671 backgroundcolor "none"
2674 \begin_layout Plain Layout
2689 \begin_layout Standard
2690 To change the background color use a colored box.
2693 \begin_layout PDF Link Setup
2698 \begin_layout Standard
2699 An example without a border and with lime background color:
2700 \begin_inset Newline newline
2704 \begin_inset Flex PDFAction
2707 \begin_layout Plain Layout
2708 \begin_inset Argument 1
2711 \begin_layout Plain Layout
2718 \begin_inset Box Frameless
2728 height_special "totalheight"
2733 backgroundcolor "lime"
2736 \begin_layout Plain Layout
2751 \begin_layout PDF Link Setup
2753 pdfborder={0 0 1}, menubordercolor={1 0 0}
2756 \begin_layout Section
2757 Dynamic form elements
2760 \begin_layout Standard
2761 It is also possible to have dynamic form elements.
2762 This means that depending on the actions of the user elements can (dis)appear
2763 or change their appearance.
2764 To use this feature, add these lines to your LaTeX preamble:
2767 \begin_layout Standard
2772 usepackage[pdftex]{insdljs}
2773 \begin_inset Newline newline
2787 \begin_layout Standard
2788 Then add the necessary JavaScript code to your document LaTeX preamble or
2790 code to your document.
2791 For info about JavaScript, see its documentation,
2792 \begin_inset CommandInset citation
2801 \begin_layout Standard
2805 \begin_layout Plain Layout
2815 \begin_inset Note Note
2818 \begin_layout Plain Layout
2819 The following section will only be displayed when the \SpecialChar LaTeX
2832 \begin_layout Standard
2833 For the following choice menu this JavaScript code was used:
2836 \begin_layout Standard
2837 \begin_inset listings
2838 lstparams "language=TeX"
2842 \begin_layout Plain Layout
2846 begin{insDLJS}[exaaae]{exaaae}{JavaScript}
2849 \begin_layout Plain Layout
2851 function validateTime(){
2854 \begin_layout Plain Layout
2859 \begin_layout Plain Layout
2861 if((event.value == "u") || (event.value == "unlimited")) {
2864 \begin_layout Plain Layout
2866 this.getField("from").display = display.hidden;
2869 \begin_layout Plain Layout
2871 this.getField("to").display = display.hidden;
2874 \begin_layout Plain Layout
2879 \begin_layout Plain Layout
2881 this.getField("from").display = display.visible;
2884 \begin_layout Plain Layout
2886 this.getField("to").display = display.visible;
2889 \begin_layout Plain Layout
2891 this.getField("from").setFocus();
2894 \begin_layout Plain Layout
2899 \begin_layout Plain Layout
2904 \begin_layout Plain Layout
2909 \begin_layout Plain Layout
2921 \begin_layout Standard
2922 \begin_inset Note Greyedout
2925 \begin_layout Plain Layout
2934 JavaScript functions must be inserted into the same
2946 \begin_layout Standard
2951 of the following choice menu are
2952 \begin_inset Newline newline
2957 name=contract,radio,default=tl,validate={validateTime();}
2960 \begin_layout Standard
2961 \begin_inset Flex ChoiceMenu
2964 \begin_layout Plain Layout
2965 \begin_inset Argument 1
2968 \begin_layout Plain Layout
2969 name=contract,radio,default=tl,validate={validateTime();}
2974 term-limited=tl, unlimited=u
2975 \begin_inset Argument 2
2978 \begin_layout Plain Layout
2990 \begin_inset VSpace defskip
2996 \begin_layout Standard
2997 \begin_inset Tabular
2998 <lyxtabular version="3" rows="3" columns="2">
2999 <features tabularvalignment="middle">
3000 <column alignment="left" valignment="top">
3001 <column alignment="center" valignment="top">
3003 <cell alignment="left" valignment="top" usebox="none">
3006 \begin_layout Plain Layout
3012 <cell alignment="center" valignment="top" usebox="none">
3015 \begin_layout Plain Layout
3016 \begin_inset Flex TextField
3019 \begin_layout Plain Layout
3020 \begin_inset Argument 1
3023 \begin_layout Plain Layout
3024 name=from,width=10em
3041 <cell alignment="center" valignment="top" usebox="none">
3044 \begin_layout Plain Layout
3050 <cell alignment="center" valignment="top" usebox="none">
3053 \begin_layout Plain Layout
3054 \begin_inset VSpace -1.5mm
3064 <cell alignment="left" valignment="top" usebox="none">
3067 \begin_layout Plain Layout
3073 <cell alignment="center" valignment="top" usebox="none">
3076 \begin_layout Plain Layout
3077 \begin_inset Flex TextField
3080 \begin_layout Plain Layout
3081 \begin_inset Argument 1
3084 \begin_layout Plain Layout
3108 \begin_layout Standard
3109 \begin_inset VSpace bigskip
3115 \begin_layout Standard
3116 To check and assure that the user only enters a number to a text field you
3117 can for example use this JavaScript code:
3120 \begin_layout Standard
3121 \begin_inset listings
3122 lstparams "language=TeX"
3126 \begin_layout Plain Layout
3128 function checkNumber() {
3131 \begin_layout Plain Layout
3136 \begin_layout Plain Layout
3138 if (!Number(event.value)) {
3141 \begin_layout Plain Layout
3143 app.alert("Value must be a number!");
3146 \begin_layout Plain Layout
3151 \begin_layout Plain Layout
3156 \begin_layout Plain Layout
3158 event.target.textColor = color.green;
3161 \begin_layout Plain Layout
3171 \begin_layout Standard
3172 An example text field:
3173 \begin_inset Flex TextField
3176 \begin_layout Plain Layout
3177 \begin_inset Argument 1
3180 \begin_layout Plain Layout
3181 name=onlyNumbers, align=1, validate={checkNumber();}
3194 \begin_layout Standard
3198 \begin_layout Plain Layout
3208 \begin_inset Note Note
3211 \begin_layout Plain Layout
3212 The following will be displayed when the \SpecialChar LaTeX
3225 \begin_layout Standard
3226 You need to install the package
3230 to see the content of this section in the output.
3233 \begin_layout Standard
3237 \begin_layout Plain Layout
3249 \begin_layout End PDF Form
3251 \begin_inset Note Note
3254 \begin_layout Plain Layout
3263 \begin_layout Section
3267 \begin_layout Itemize
3268 Submitting and applying data requires that all form elements have a name.
3271 \begin_layout Itemize
3272 Creating a PDF form requires pdflatex or lualatex.
3273 Use therefore either the \SpecialChar LyX
3280 PDF (Lua\SpecialChar TeX
3286 \begin_layout Itemize
3295 custom background colors you must disable in these programs the highlighting
3298 \begin_inset Quotes eld
3301 Show border hover color for fields
3302 \begin_inset Quotes erd
3308 \begin_layout Bibliography
3309 \begin_inset CommandInset bibitem
3310 LatexCommand bibitem
3316 \begin_inset CommandInset href
3318 name "JavaScript reference"
3319 target "https://developer.mozilla.org/en/docs/Web/JavaScript/Reference"
3326 \begin_layout Bibliography
3327 \begin_inset CommandInset bibitem
3328 LatexCommand bibitem
3334 \begin_inset CommandInset href
3336 name "Documentation"
3337 target "http://mirrors.ctan.org/macros/latex/contrib/hyperref/doc/manual.pdf"
3341 of the \SpecialChar LaTeX
3347 \begin_layout Bibliography
3348 \begin_inset CommandInset bibitem
3349 LatexCommand bibitem
3355 \begin_inset CommandInset href
3357 name "Documentation"
3358 target "http://mirrors.ctan.org/macros/latex/required/psnfss/psnfss2e.pdf"
3362 of the \SpecialChar LaTeX