1 #LyX 2.3 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("until").display = display.hidden;
31 this.getField("from").display = display.visible;
32 this.getField("until").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 \use_dash_ligatures false
87 \default_output_format pdf2
89 \bibtex_command bibtex
90 \index_command default
94 \pdf_title "Description of the module pdfcomment"
95 \pdf_author "Uwe Stöhr"
96 \pdf_subject "PDF form"
97 \pdf_keywords "LyX, PDF forms, hyperref"
99 \pdf_bookmarksnumbered true
100 \pdf_bookmarksopen true
101 \pdf_bookmarksopenlevel 2
102 \pdf_breaklinks false
104 \pdf_colorlinks false
106 \pdf_pdfusetitle false
107 \pdf_quoted_options "pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false, urlbordercolor={1 0 0}"
110 \use_package amsmath 1
111 \use_package amssymb 1
112 \use_package cancel 0
114 \use_package mathdots 1
115 \use_package mathtools 1
116 \use_package mhchem 1
117 \use_package stackrel 0
118 \use_package stmaryrd 0
119 \use_package undertilde 0
121 \cite_engine_type default
125 \paperorientation portrait
129 \notefontcolor #0000ff
136 \paragraph_separation skip
139 \math_numbering_side default
140 \quotes_style english
143 \paperpagestyle default
144 \tracking_changes false
145 \output_changes false
148 \html_be_strict false
154 \begin_layout Begin PDF Form
156 \begin_inset Argument 1
159 \begin_layout Plain Layout
160 action=mailto:forms@lyx.test?subject=The submitted PDF form, method=post
169 Description of the module PDF Form
176 \begin_layout Standard
177 \begin_inset Note Note
180 \begin_layout Plain Layout
181 To export all parts of this document to PDF the \SpecialChar LaTeX
187 If it is not installed you can export the document anyway but the example
188 in the section about dynamic form elements will not appear in the output.
196 \begin_layout Standard
197 By loading the module PDF
201 Form the whole document or a part of it can be made a PDF form.
202 You can add all possible form elements like text fields buttons etc.
203 This document describes how this is done.
206 \begin_layout Section
208 \begin_inset CommandInset label
210 name "sec:Preparation"
217 \begin_layout Standard
218 At first load the module PDF
222 Form in the document settings of your file.
223 To make the whole document a form, insert the environment
235 from \SpecialChar LyX
236 's dropdown menu at the beginning of the document.
237 If only a part of the document should be a form, add
249 at the position where the form should start.
252 \begin_layout Standard
253 \begin_inset Note Greyedout
256 \begin_layout Plain Layout
261 It is only possible to have one form in a PDF file!
269 \begin_layout Standard
270 If the form data should be submitted to a server or the like, then you must
271 specify the URL as parameter of the
284 This is done by using the menu
286 Insert\SpecialChar menuseparator
298 For example in this document the following was inserted to the parameter
302 \begin_layout Standard
305 action=mailto:forms@lyx.test?subject=The submitted PDF form,
306 \begin_inset Newline newline
312 \begin_layout Standard
313 This sends the form data as email to
317 when the user presses the submit button.
318 The email subject will be
319 \begin_inset Quotes eld
322 The submitted PDF form
323 \begin_inset Quotes erd
326 and the submit method is
331 (The other possible method would be
335 .) For more about submitting see sec.
336 \begin_inset space \thinspace{}
340 \begin_inset CommandInset ref
342 reference "subsec:Submit-button"
349 \begin_layout Standard
350 \begin_inset Newpage newpage
356 \begin_layout Section
360 \begin_layout Standard
365 possible elements in a PDF form:
368 \begin_layout Subsection
372 \begin_layout Standard
373 A text field is added by inserting the custom inset
379 Insert\SpecialChar menuseparator
387 Write inside the inset the label for the text field that will be printed
388 in the PDF output before the field.
390 \begin_inset Newline newline
394 \begin_inset Flex TextField
397 \begin_layout Plain Layout
398 \begin_inset Argument 1
401 \begin_layout Plain Layout
407 Enter your name here:
415 \begin_layout Standard
416 You must also specify a name for text fields.
417 To do this set the cursor into its
421 inset and insert the parameter
432 \begin_layout Standard
433 Using the same name for several text fields results in an automatic duplication
434 of the inserted text.
435 This is for example useful if the user should input a date that should
436 appear at different places in the form.
437 \begin_inset Newline newline
444 fields as example: Fill one and see that the other one will be filled automatica
445 lly when you click outside of the field:
446 \begin_inset Newline newline
450 \begin_inset Flex TextField
453 \begin_layout Plain Layout
454 \begin_inset Argument 1
457 \begin_layout Plain Layout
469 \begin_inset Newline newline
473 \begin_inset Flex TextField
476 \begin_layout Plain Layout
477 \begin_inset Argument 1
480 \begin_layout Plain Layout
494 \begin_layout Standard
495 \begin_inset Note Greyedout
498 \begin_layout Plain Layout
503 Special characters should be avoided in element names.
511 \begin_layout Standard
512 All form fields can be customized by adding parameters.
515 \begin_layout Standard
516 Here is a customized multiline text field with a width of 60
517 \begin_inset space \thinspace{}
520 % of the text width, 3
521 \begin_inset space \thinspace{}
524 cm height and a proposed content:
525 \begin_inset VSpace defskip
529 \begin_inset Newline newline
533 \begin_inset Flex TextField
536 \begin_layout Plain Layout
537 \begin_inset Argument 1
540 \begin_layout Plain Layout
541 name=customer2, multiline, width=0.6
543 textwidth, height=3cm, value={proposed text}
548 Enter your name here:
556 \begin_layout Standard
557 \begin_inset Note Greyedout
560 \begin_layout Plain Layout
565 It is highly recommended to use a uniform layout of all fields in a form.
567 \begin_inset space \thinspace{}
571 \begin_inset CommandInset ref
573 reference "sec:Form-element-customization"
585 \begin_layout Subsection
589 \begin_layout Standard
590 A check box is added by inserting the custom inset
595 Write inside the inset the label for the box.
597 \begin_inset Newline newline
601 \begin_inset Flex CheckBox
604 \begin_layout Plain Layout
605 \begin_inset Argument 1
608 \begin_layout Plain Layout
614 Are you older than 18 years?
622 \begin_layout Standard
623 You must specify also for check boxes a name.
625 \begin_inset space \thinspace{}
629 \begin_inset space \space{}
640 is the name) into the
647 \begin_layout Subsection
651 \begin_layout Standard
652 A choice menu is added by inserting the custom inset
657 A label for the inset is added by using the menu
659 Insert\SpecialChar menuseparator
663 The different choices are inserted to the inset as comma-separated list.
671 \begin_layout Description
672 Radio Only one choice can be selected
675 \begin_layout Description
676 Combo The choices are listed in a combo box (dropdown list) but the user
677 is allowed to input something that is not in the predefined list.
680 \begin_layout Description
681 Popdown All choices are listed below each other.
682 If the menu is not high enough a scroll bar is automatically added.
685 \begin_layout Standard
686 To determine the choice menu type one uses the parameter
701 \begin_layout Standard
702 Here is an example for the radio type:
703 \begin_inset VSpace defskip
707 \begin_inset Newline newline
711 \begin_inset Flex ChoiceMenu
714 \begin_layout Plain Layout
715 \begin_inset Argument 1
718 \begin_layout Plain Layout
725 \begin_inset Argument 2
728 \begin_layout Plain Layout
742 \begin_layout Standard
743 Here is an example for the combo type:
744 \begin_inset VSpace defskip
748 \begin_inset Newline newline
752 \begin_inset Flex ChoiceMenu
755 \begin_layout Plain Layout
756 \begin_inset Argument 1
759 \begin_layout Plain Layout
765 Albania=Al, Armenia=Ar, Azerbaidschan=Az
766 \begin_inset Argument 2
769 \begin_layout Plain Layout
783 \begin_layout Standard
784 Here is an example for the popdown type:
785 \begin_inset VSpace defskip
789 \begin_inset Newline newline
793 \begin_inset Flex ChoiceMenu
796 \begin_layout Plain Layout
797 \begin_inset Argument 1
800 \begin_layout Plain Layout
801 popdown, name=country
806 Albania=Al, Armenia=Ar, Azerbaidschan=Az
807 \begin_inset Argument 2
810 \begin_layout Plain Layout
824 \begin_layout Standard
825 You must also specify a name for choice menus.
826 Insert for example the parameter
834 is the name) into the
841 \begin_layout Standard
842 It is recommended to add a short name for every choice to be able to access
843 them and to know which one was chosen by the user.
844 This is done by adding
848 behind each choice (where
853 For example the radio type example contains this choice list:
859 \begin_inset Quotes eld
863 \begin_inset Quotes erd
866 you know that he chose the choice
867 \begin_inset Quotes eld
871 \begin_inset Quotes erd
875 With the name you can also preset/propose e.g.
876 \begin_inset space \space{}
880 \begin_inset Quotes eld
884 \begin_inset Quotes erd
887 by adding the parameter
895 \begin_layout Standard
896 \begin_inset Flex ChoiceMenu
899 \begin_layout Plain Layout
900 \begin_inset Argument 1
903 \begin_layout Plain Layout
904 radio, name=sex, default=m
910 \begin_inset Argument 2
913 \begin_layout Plain Layout
927 \begin_layout Subsection
931 \begin_layout Standard
932 A push button is added by inserting the custom inset
937 Write inside the inset the label for the button.
941 \begin_layout Standard
942 \begin_inset Flex PushButton
945 \begin_layout Plain Layout
946 \begin_inset Argument 1
949 \begin_layout Plain Layout
955 Don't click on this button or your fridge will be destroyed!!!
963 \begin_layout Standard
964 The action that is triggered by pressing the button is specified by JavaScript
966 To do this, add the parameter
970 and insert the JavaScript code between the braces.
971 For info about JavaScript, see its documentation,
972 \begin_inset CommandInset citation
980 In the following example this JavaScript code was used:
981 \begin_inset Newline newline
990 \begin_layout Plain Layout
997 What the hell? Now you destroyed your fridge.
999 \begin_inset Quotes eld
1003 \begin_inset Quotes erd
1010 \begin_layout Plain Layout
1020 \begin_layout Standard
1021 \begin_inset Flex PushButton
1024 \begin_layout Plain Layout
1025 \begin_inset Argument 1
1028 \begin_layout Plain Layout
1033 \begin_layout Plain Layout
1040 What the hell? Now you destroyed your fridge.
1042 \begin_inset Quotes eld
1046 \begin_inset Quotes erd
1053 \begin_layout Plain Layout
1065 Don't click on this button or your fridge will be destroyed!!!
1073 \begin_layout Standard
1074 \begin_inset Note Greyedout
1077 \begin_layout Plain Layout
1082 The outer quotes are part of the JavaScript code and must therefore be
1083 inserted as \SpecialChar TeX
1092 \begin_layout Standard
1093 A common usage for push buttons is to open a weblink.
1094 Such a button is created by inserting a hyperlink as button text.
1098 \begin_layout Standard
1099 \begin_inset Flex PushButton
1102 \begin_layout Plain Layout
1103 \begin_inset Argument 1
1106 \begin_layout Plain Layout
1113 \begin_inset CommandInset href
1115 name "Information how to fill out this form"
1116 target "http://wiki.lyx.org"
1129 \begin_layout Standard
1130 To get rid of the predefined frame for weblinks add this to the additional
1131 options in the document settings under
1134 \begin_inset space ~
1142 \begin_layout Standard
1145 urlbordercolor={1 0 0}
1148 \begin_layout Standard
1149 if your push button border color is red (the default), otherwise use the
1150 same color definition as for your push button border color.
1153 \begin_layout Subsection
1155 \begin_inset CommandInset label
1157 name "subsec:Submit-button"
1164 \begin_layout Standard
1165 A submit button is used to submit the form data to a server.
1166 It is added by inserting the custom inset
1171 The label for the button is written into the inset.
1175 \begin_layout Standard
1176 \begin_inset Flex SubmitButton
1179 \begin_layout Plain Layout
1180 \begin_inset Argument 1
1183 \begin_layout Plain Layout
1189 Send your data via email
1197 \begin_layout Standard
1198 The submit button creates a forms data format (FDF) file (file extension
1199 *.fdf) which is then submitted.
1200 The FDF file contains only the form data.
1201 They can later only be applied to a PDF form if all elements in the form
1205 \begin_layout Standard
1206 \begin_inset Note Greyedout
1209 \begin_layout Plain Layout
1214 You can only use a submit button if you specified the submit method and
1215 a target in the inset
1218 \begin_inset space ~
1222 \begin_inset space ~
1228 \begin_inset space \thinspace{}
1232 \begin_inset CommandInset ref
1234 reference "sec:Preparation"
1238 for the description.
1239 If there are no specifications you will get \SpecialChar LaTeX
1248 \begin_layout Subsection
1252 \begin_layout Standard
1253 A reset button is used to reset all form elements to the initial state.
1254 It is added by inserting the custom inset
1259 The label for the button is written into the inset.
1263 \begin_layout Standard
1264 \begin_inset Flex ResetButton
1267 \begin_layout Plain Layout
1268 \begin_inset Argument 1
1271 \begin_layout Plain Layout
1285 \begin_layout Section
1286 Form element customization
1287 \begin_inset CommandInset label
1289 name "sec:Form-element-customization"
1296 \begin_layout Standard
1297 Since all form elements should look uniform, one can determine their layout
1298 using the following styles:
1301 \begin_layout Description
1303 \begin_inset space ~
1307 \begin_inset space ~
1313 \begin_layout Description
1315 \begin_inset space ~
1319 \begin_inset space ~
1325 \begin_layout Description
1327 \begin_inset space ~
1331 \begin_inset space ~
1334 Style affects all choice menu types
1337 \begin_layout Description
1339 \begin_inset space ~
1343 \begin_inset space ~
1346 Style affects only the combo box style
1349 \begin_layout Description
1351 \begin_inset space ~
1355 \begin_inset space ~
1358 Style affects only the popdown box style
1361 \begin_layout Description
1363 \begin_inset space ~
1367 \begin_inset space ~
1370 Style affects only the radio box style
1373 \begin_layout Description
1375 \begin_inset space ~
1379 \begin_inset space ~
1385 \begin_layout Description
1387 \begin_inset space ~
1391 \begin_inset space ~
1397 \begin_layout Description
1399 \begin_inset space ~
1403 \begin_inset space ~
1409 \begin_layout Standard
1410 The content of the styles is a comma-separated list of parameters.
1411 The possible parameters are listed in sec.
1412 \begin_inset space \thinspace{}
1416 \begin_inset Quotes eld
1419 Forms optional parameters
1420 \begin_inset Quotes erd
1423 of the documentation of the \SpecialChar LaTeX
1429 \begin_inset CommandInset citation
1437 It is important that the parameter
1441 is always part of the definition.
1442 Otherwise the elements will not appear in the PDF.
1443 The defined style is applied to all elements following the definition.
1446 \begin_layout Subsubsection*
1447 Here are some examples:
1450 \begin_layout Text Field Style
1452 print, bordercolor=red, borderstyle=U, backgroundcolor=lightgray, color=lime,
1453 maxlen=10, align=2, charsize=16pt
1454 \begin_inset Note Note
1457 \begin_layout Plain Layout
1490 \begin_layout Check Box Style
1492 print, borderstyle=S, checkboxsymbol=
1497 \begin_layout Combo Box Style
1499 print, bordercolor={0.33 0.66 0.33}, borderstyle=D
1502 \begin_layout Popdown Box Style
1505 \begin_inset Note Note
1508 \begin_layout Plain Layout
1513 determines the number of displayed menu entries.
1514 It does not work currently because of a bug in the \SpecialChar LaTeX
1527 \begin_layout Radio Box Style
1529 print, borderstyle=I, radiosymbol=3
1532 \begin_layout Push Button Style
1534 print, borderstyle=B, bordercolor=lime
1537 \begin_layout Submit Button Style
1539 print, borderwidth=0, bordercolor=white
1542 \begin_layout Reset Button Style
1544 print, bordercolor=lime
1547 \begin_layout Itemize
1548 Text field with gray background, lime text color, a red border only below
1549 the field, right alignment, 16
1550 \begin_inset space \thinspace{}
1553 pt font size and a limitation for maximal 10
1554 \begin_inset space ~
1557 characters to insert:
1558 \begin_inset VSpace defskip
1562 \begin_inset Newline newline
1566 \begin_inset Flex TextField
1569 \begin_layout Plain Layout
1570 \begin_inset Argument 1
1573 \begin_layout Plain Layout
1579 Enter your name here:
1587 \begin_layout Standard
1588 \begin_inset Note Greyedout
1591 \begin_layout Plain Layout
1604 custom background colors you must disable in these programs the highlighting
1607 \begin_inset Quotes eld
1610 Show border hover color for fields
1611 \begin_inset Quotes erd
1622 \begin_layout Itemize
1623 Check box with normal border and symbol
1626 \begin_inset VSpace defskip
1630 \begin_inset Newline newline
1634 \begin_inset Flex CheckBox
1637 \begin_layout Plain Layout
1638 \begin_inset Argument 1
1641 \begin_layout Plain Layout
1647 Are you older than 18 years?
1655 \begin_layout Standard
1656 The symbol is either specified as number or with the command
1657 \begin_inset Newline newline
1667 \begin_inset Newline newline
1674 is one of the possible numbers listed in Table
1675 \begin_inset space ~
1678 2 of the documentation of the \SpecialChar LaTeX
1684 \begin_inset CommandInset citation
1694 \begin_layout Itemize
1695 Combo choice menu with dashed, colored border where the last entry is preselecte
1697 \begin_inset VSpace defskip
1701 \begin_inset Newline newline
1705 \begin_inset Flex ChoiceMenu
1708 \begin_layout Plain Layout
1709 \begin_inset Argument 1
1712 \begin_layout Plain Layout
1713 combo, name=combo2, default=Az
1718 Albania=Al, Armenia=Ar, Azerbaidschan=Az
1719 \begin_inset Argument 2
1722 \begin_layout Plain Layout
1736 \begin_layout Itemize
1737 Popdown choice menu where the second entry is preselected:
1738 \begin_inset VSpace defskip
1742 \begin_inset Newline newline
1746 \begin_inset Flex ChoiceMenu
1749 \begin_layout Plain Layout
1750 \begin_inset Argument 1
1753 \begin_layout Plain Layout
1754 popdown, name=country2, default=Ar
1759 Albania=Al, Armenia=Ar, Azerbaidschan=Az
1760 \begin_inset Argument 2
1763 \begin_layout Plain Layout
1777 \begin_layout Standard
1778 \begin_inset VSpace defskip
1782 \begin_inset Note Greyedout
1785 \begin_layout Plain Layout
1802 have no effect for popdown choice menus.
1810 \begin_layout Itemize
1811 Radio choice menu with inverted bevel border and symbol number
1812 \begin_inset space ~
1816 \begin_inset VSpace defskip
1820 \begin_inset Newline newline
1824 \begin_inset Flex ChoiceMenu
1827 \begin_layout Plain Layout
1828 \begin_inset Argument 1
1831 \begin_layout Plain Layout
1838 \begin_inset Argument 2
1841 \begin_layout Plain Layout
1855 \begin_layout Standard
1856 \begin_inset VSpace defskip
1860 \begin_inset Note Greyedout
1863 \begin_layout Plain Layout
1884 have no effect for push, submit and reset buttons.
1892 \begin_layout Standard
1893 As workaround use a colored box and/or color the box text.
1896 \begin_layout Itemize
1897 Push button with a bevel border and colored text:
1898 \begin_inset VSpace defskip
1902 \begin_inset Newline newline
1906 \begin_inset Flex PushButton
1909 \begin_layout Plain Layout
1910 \begin_inset Argument 1
1913 \begin_layout Plain Layout
1918 \begin_layout Plain Layout
1925 Why do you click this?
1929 \begin_layout Plain Layout
1942 \begin_inset Box Frameless
1952 height_special "totalheight"
1957 backgroundcolor "lime"
1960 \begin_layout Plain Layout
1963 Don't click on this button!!!
1974 \begin_inset VSpace bigskip
1980 \begin_layout Itemize
1981 Submit button without border, with cyan background and increased height:
1982 \begin_inset VSpace defskip
1986 \begin_inset Newline newline
1990 \begin_inset Flex SubmitButton
1993 \begin_layout Plain Layout
1994 \begin_inset Argument 1
1997 \begin_layout Plain Layout
2004 \begin_inset Box Frameless
2014 height_special "totalheight"
2019 backgroundcolor "cyan"
2022 \begin_layout Plain Layout
2023 \begin_inset Box Frameless
2033 height_special "totalheight"
2038 backgroundcolor "none"
2041 \begin_layout Plain Layout
2042 Send your data via mail
2058 \begin_inset VSpace bigskip
2064 \begin_layout Itemize
2065 Reset button with a width of 7
2066 \begin_inset space \thinspace{}
2070 \begin_inset VSpace defskip
2074 \begin_inset Newline newline
2078 \begin_inset Flex ResetButton
2081 \begin_layout Plain Layout
2082 \begin_inset Argument 1
2085 \begin_layout Plain Layout
2092 \begin_inset Box Frameless
2102 height_special "totalheight"
2107 backgroundcolor "none"
2110 \begin_layout Plain Layout
2124 \begin_layout Standard
2125 \begin_inset Newpage newpage
2131 \begin_layout Section
2135 \begin_layout Standard
2136 One often needs basic actions to be done by the PDF viewer program, for
2137 example to print the form.
2138 Such PDF program-specific actions can be triggered by adding inserting
2152 can handle all possible actions while other PDF viewers might only support
2154 However, all PDF viewers support the basic things like printing, save
2155 \begin_inset space ~
2158 as, view in fullscreen etc..
2161 \begin_layout Standard
2162 To specify the action insert its name to the
2167 A list with possible action names can be found in sec.
2168 \begin_inset space \thinspace{}
2172 \begin_inset Quotes eld
2175 Acrobat-specific behavior
2176 \begin_inset Quotes erd
2179 of the documentation of the \SpecialChar LaTeX
2185 \begin_inset CommandInset citation
2195 \begin_layout Standard
2196 Here are some examples:
2199 \begin_layout Description
2201 \begin_inset Flex PDFAction
2204 \begin_layout Plain Layout
2205 \begin_inset Argument 1
2208 \begin_layout Plain Layout
2222 \begin_layout Description
2224 \begin_inset space ~
2228 \begin_inset Flex PDFAction
2231 \begin_layout Plain Layout
2232 \begin_inset Argument 1
2235 \begin_layout Plain Layout
2249 \begin_layout Description
2251 \begin_inset space ~
2255 \begin_inset space ~
2259 \begin_inset Flex PDFAction
2262 \begin_layout Plain Layout
2263 \begin_inset Argument 1
2266 \begin_layout Plain Layout
2272 View the form in fullscreen
2280 \begin_layout Subsection
2281 Action button customization
2282 \begin_inset CommandInset label
2284 name "subsec:Action-button-customization"
2291 \begin_layout Standard
2292 Customizing the action buttons requires the usage of boxes because things
2293 like the width, height and border separation cannot be specified as button
2297 \begin_layout Standard
2298 The easiest way to customize the buttons is to fill it with a custom box.
2299 For example the button should be 5
2300 \begin_inset space \thinspace{}
2303 cm wide and have the height of 2
2304 \begin_inset space ~
2308 Then create this parbox:
2311 \begin_layout Standard
2312 \begin_inset Box Frameless
2322 height_special "totalheight"
2327 backgroundcolor "none"
2330 \begin_layout Plain Layout
2340 \begin_layout Standard
2349 \begin_layout Standard
2350 \begin_inset Flex PDFAction
2353 \begin_layout Plain Layout
2354 \begin_inset Argument 1
2357 \begin_layout Plain Layout
2364 \begin_inset Box Frameless
2374 height_special "totalheight"
2379 backgroundcolor "none"
2382 \begin_layout Plain Layout
2396 \begin_layout PDF Link Setup
2399 \begin_inset Note Note
2402 \begin_layout Plain Layout
2403 Sets the thickness of the predefined link border to zero as described below.
2411 \begin_layout Standard
2412 To customize the border color, border thickness and the distance to the
2413 border one changes the border settings of the box.
2415 \begin_inset space \thinspace{}
2418 pt thick, teal border and 3
2419 \begin_inset space \thinspace{}
2422 pt border separation :
2423 \begin_inset VSpace defskip
2427 \begin_inset Newline newline
2431 \begin_inset Flex PDFAction
2434 \begin_layout Plain Layout
2435 \begin_inset Argument 1
2438 \begin_layout Plain Layout
2445 \begin_inset Box Boxed
2455 height_special "totalheight"
2460 backgroundcolor "white"
2463 \begin_layout Plain Layout
2478 \begin_layout Standard
2479 To customize the border thickness, add the command
2483 to the additional options in the document settings under
2486 \begin_inset space ~
2495 with a number that is the thickness in pixels.
2496 If you want to change the border thickness only for certain buttons, use
2500 \begin_inset space ~
2504 \begin_inset space ~
2509 before the button and insert there the command
2514 The default value of
2525 \begin_layout Standard
2526 \begin_inset Note Greyedout
2529 \begin_layout Plain Layout
2538 affects all link types, not only the action links.
2546 \begin_layout PDF Link Setup
2551 \begin_layout Standard
2553 \begin_inset space ~
2557 \begin_inset Newline newline
2561 \begin_inset Flex PDFAction
2564 \begin_layout Plain Layout
2565 \begin_inset Argument 1
2568 \begin_layout Plain Layout
2575 \begin_inset Box Frameless
2585 height_special "totalheight"
2590 backgroundcolor "none"
2593 \begin_layout Plain Layout
2608 \begin_layout Standard
2609 To change the border color use the command
2611 menubordercolor={r g b}
2625 are numbers between 0 and 1 for the colors red, green and blue.
2626 The default value of
2637 \begin_layout PDF Link Setup
2639 pdfborder={0 0 1}, menubordercolor={0.1 0.9 0.5}
2642 \begin_layout Standard
2645 menubordercolor={0.1 0.9 0.5}
2648 \begin_inset Newline newline
2652 \begin_inset Flex PDFAction
2655 \begin_layout Plain Layout
2656 \begin_inset Argument 1
2659 \begin_layout Plain Layout
2666 \begin_inset Box Frameless
2676 height_special "totalheight"
2681 backgroundcolor "none"
2684 \begin_layout Plain Layout
2699 \begin_layout Standard
2700 To change the background color use a colored box.
2703 \begin_layout PDF Link Setup
2708 \begin_layout Standard
2709 An example without a border and with lime background color:
2710 \begin_inset Newline newline
2714 \begin_inset Flex PDFAction
2717 \begin_layout Plain Layout
2718 \begin_inset Argument 1
2721 \begin_layout Plain Layout
2728 \begin_inset Box Frameless
2738 height_special "totalheight"
2743 backgroundcolor "lime"
2746 \begin_layout Plain Layout
2761 \begin_layout PDF Link Setup
2763 pdfborder={0 0 1}, menubordercolor={1 0 0}
2766 \begin_layout Section
2767 Dynamic form elements
2770 \begin_layout Standard
2771 It is also possible to have dynamic form elements.
2772 This means that depending on the actions of the user elements can (dis)appear
2773 or change their appearance.
2774 To use this feature, add these lines to your LaTeX preamble:
2777 \begin_layout Standard
2782 usepackage[pdftex]{insdljs}
2783 \begin_inset Newline newline
2797 \begin_layout Standard
2798 Then add the necessary JavaScript code to your document LaTeX preamble or
2800 code to your document.
2801 For info about JavaScript, see its documentation,
2802 \begin_inset CommandInset citation
2812 \begin_layout Standard
2816 \begin_layout Plain Layout
2826 \begin_inset Note Note
2829 \begin_layout Plain Layout
2830 The following section will only be displayed when the \SpecialChar LaTeX
2843 \begin_layout Standard
2844 For the following choice menu this JavaScript code was used:
2847 \begin_layout Standard
2848 \begin_inset listings
2849 lstparams "language=TeX"
2853 \begin_layout Plain Layout
2857 begin{insDLJS}[exaaae]{exaaae}{JavaScript}
2860 \begin_layout Plain Layout
2862 function validateTime(){
2865 \begin_layout Plain Layout
2870 \begin_layout Plain Layout
2872 if((event.value == "u") || (event.value == "unlimited")) {
2875 \begin_layout Plain Layout
2877 this.getField("from").display = display.hidden;
2880 \begin_layout Plain Layout
2882 this.getField("until").display = display.hidden;
2885 \begin_layout Plain Layout
2890 \begin_layout Plain Layout
2892 this.getField("from").display = display.visible;
2895 \begin_layout Plain Layout
2897 this.getField("until").display = display.visible;
2900 \begin_layout Plain Layout
2902 this.getField("from").setFocus();
2905 \begin_layout Plain Layout
2910 \begin_layout Plain Layout
2915 \begin_layout Plain Layout
2920 \begin_layout Plain Layout
2932 \begin_layout Standard
2933 \begin_inset Note Greyedout
2936 \begin_layout Plain Layout
2945 JavaScript functions must be inserted into the same
2957 \begin_layout Standard
2962 of the following choice menu are
2963 \begin_inset Newline newline
2968 name=contract,radio,default=tl,validate={validateTime();}
2971 \begin_layout Standard
2972 \begin_inset Flex ChoiceMenu
2975 \begin_layout Plain Layout
2976 \begin_inset Argument 1
2979 \begin_layout Plain Layout
2980 name=contract,radio,default=tl,validate={validateTime();}
2985 term-limited=tl, unlimited=u
2986 \begin_inset Argument 2
2989 \begin_layout Plain Layout
3001 \begin_inset VSpace defskip
3007 \begin_layout Standard
3008 \begin_inset Tabular
3009 <lyxtabular version="3" rows="3" columns="2">
3010 <features tabularvalignment="middle">
3011 <column alignment="left" valignment="top">
3012 <column alignment="center" valignment="top">
3014 <cell alignment="left" valignment="top" usebox="none">
3017 \begin_layout Plain Layout
3023 <cell alignment="center" valignment="top" usebox="none">
3026 \begin_layout Plain Layout
3027 \begin_inset Flex TextField
3030 \begin_layout Plain Layout
3031 \begin_inset Argument 1
3034 \begin_layout Plain Layout
3035 name=from,width=10em
3052 <cell alignment="center" valignment="top" usebox="none">
3055 \begin_layout Plain Layout
3061 <cell alignment="center" valignment="top" usebox="none">
3064 \begin_layout Plain Layout
3065 \begin_inset VSpace -1.5mm
3075 <cell alignment="left" valignment="top" usebox="none">
3078 \begin_layout Plain Layout
3084 <cell alignment="center" valignment="top" usebox="none">
3087 \begin_layout Plain Layout
3088 \begin_inset Flex TextField
3091 \begin_layout Plain Layout
3092 \begin_inset Argument 1
3095 \begin_layout Plain Layout
3096 name=until,width=10em
3119 \begin_layout Standard
3120 \begin_inset VSpace bigskip
3126 \begin_layout Standard
3127 To check and assure that the user only enters a number to a text field you
3128 can for example use this JavaScript code:
3131 \begin_layout Standard
3132 \begin_inset listings
3133 lstparams "language=TeX"
3137 \begin_layout Plain Layout
3139 function checkNumber() {
3142 \begin_layout Plain Layout
3147 \begin_layout Plain Layout
3149 if (!Number(event.value)) {
3152 \begin_layout Plain Layout
3154 app.alert("Value must be a number!");
3157 \begin_layout Plain Layout
3162 \begin_layout Plain Layout
3167 \begin_layout Plain Layout
3169 event.target.textColor = color.green;
3172 \begin_layout Plain Layout
3182 \begin_layout Standard
3183 An example text field:
3184 \begin_inset Flex TextField
3187 \begin_layout Plain Layout
3188 \begin_inset Argument 1
3191 \begin_layout Plain Layout
3192 name=onlyNumbers, align=1, validate={checkNumber();}
3205 \begin_layout Standard
3209 \begin_layout Plain Layout
3219 \begin_inset Note Note
3222 \begin_layout Plain Layout
3223 The following will be displayed when the \SpecialChar LaTeX
3236 \begin_layout Standard
3237 You need to install the package
3241 to see the content of this section in the output.
3244 \begin_layout Standard
3248 \begin_layout Plain Layout
3260 \begin_layout End PDF Form
3262 \begin_inset Note Note
3265 \begin_layout Plain Layout
3274 \begin_layout Section
3278 \begin_layout Itemize
3279 Submitting and applying data requires that all form elements have a name.
3282 \begin_layout Itemize
3283 Creating a PDF form requires pdf\SpecialChar TeX
3284 or Lua\SpecialChar TeX
3286 Use therefore either the \SpecialChar LyX
3298 \begin_layout Itemize
3307 custom background colors you must disable in these programs the highlighting
3310 \begin_inset Quotes eld
3313 Show border hover color for fields
3314 \begin_inset Quotes erd
3320 \begin_layout Bibliography
3321 \begin_inset CommandInset bibitem
3322 LatexCommand bibitem
3329 \begin_inset CommandInset href
3331 name "JavaScript reference"
3332 target "https://developer.mozilla.org/en/docs/Web/JavaScript/Reference"
3340 \begin_layout Bibliography
3341 \begin_inset CommandInset bibitem
3342 LatexCommand bibitem
3349 \begin_inset CommandInset href
3351 name "Documentation"
3352 target "http://mirrors.ctan.org/macros/latex/contrib/hyperref/doc/manual.pdf"
3357 of the \SpecialChar LaTeX
3363 \begin_layout Bibliography
3364 \begin_inset CommandInset bibitem
3365 LatexCommand bibitem
3372 \begin_inset CommandInset href
3374 name "Documentation"
3375 target "http://mirrors.ctan.org/macros/latex/required/psnfss/psnfss2e.pdf"
3380 of the \SpecialChar LaTeX