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
150 \begin_inset Argument 1
153 \begin_layout Plain Layout
154 action=mailto:forms@lyx.test?subject=The submitted PDF form, method=post
163 Description of the module PDF Form
170 \begin_layout Standard
171 \begin_inset Note Note
174 \begin_layout Plain Layout
175 To export all parts of this document to PDF the \SpecialChar LaTeX
181 If it is not installed you can export the document anyway but the example
182 in the section about dynamic form fields won't appear in the output.
190 \begin_layout Standard
191 By loading the module PDF
195 Form the whole document or a part of it can be made a PDF form.
196 You can add all possible form elements like text fields buttons etc.
197 This document describes how this is done.
200 \begin_layout Section
202 \begin_inset CommandInset label
204 name "sec:Preparation"
211 \begin_layout Standard
212 At first load the module PDF
216 Form in the document settings of your file.
217 To make the whole document a form, insert the environment
229 from \SpecialChar LyX
230 's dropdown menu at the beginning of the document.
231 If only a part of the document should be a form, add
243 at the position where the form should start.
246 \begin_layout Standard
247 \begin_inset Note Greyedout
250 \begin_layout Plain Layout
255 It is only possible to have one form in a PDF file!
263 \begin_layout Standard
264 If the form data should be submitted to a server or the like, then you must
265 specify the URL as parameter of the
278 This is done by using the menu
280 Insert\SpecialChar menuseparator
292 For example in this document the following was inserted to the parameter
296 \begin_layout Standard
299 action=mailto:forms@lyx.test?subject=The submitted PDF form,
300 \begin_inset Newline newline
306 \begin_layout Standard
307 This sends the form data as email to
311 when the user presses the submit button.
312 The email subject will be
313 \begin_inset Quotes eld
316 The submitted PDF form
317 \begin_inset Quotes erd
320 and the submit method is
325 (The other possible method would be
329 .) For more about submitting see sec.
330 \begin_inset space \thinspace{}
334 \begin_inset CommandInset ref
336 reference "subsec:Submit-button"
343 \begin_layout Standard
344 \begin_inset Newpage newpage
350 \begin_layout Section
354 \begin_layout Standard
359 possible elements in a PDF form:
362 \begin_layout Subsection
366 \begin_layout Standard
367 A text field is added by inserting the custom inset
373 Insert\SpecialChar menuseparator
381 Write inside the inset the label for the text field that will be printed
382 in the PDF output before the field.
384 \begin_inset Newline newline
388 \begin_inset Flex TextField
391 \begin_layout Plain Layout
392 \begin_inset Argument 1
395 \begin_layout Plain Layout
401 Enter your name here:
409 \begin_layout Standard
410 You must also specify a name for text fields: Set the cursor into its
415 There insert the parameter
426 \begin_layout Standard
427 Using the same name for several text fields results in an automatic duplication
428 of the inserted text.
429 This is for example useful if the user should input a date that should
430 appear at different places in the form.
431 \begin_inset Newline newline
438 fields as example: Fill one and see that the other one will also be filled
439 automatically when you click outside of the field:
440 \begin_inset Newline newline
444 \begin_inset Flex TextField
447 \begin_layout Plain Layout
448 \begin_inset Argument 1
451 \begin_layout Plain Layout
463 \begin_inset Newline newline
467 \begin_inset Flex TextField
470 \begin_layout Plain Layout
471 \begin_inset Argument 1
474 \begin_layout Plain Layout
488 \begin_layout Standard
489 \begin_inset Note Greyedout
492 \begin_layout Plain Layout
497 Special characters should be avoided in element names.
505 \begin_layout Standard
506 All form fields can be customized by adding parameters.
509 \begin_layout Standard
510 Here is a customized multiline text field with a width of 60
511 \begin_inset space \thinspace{}
514 % of the text width, 3
515 \begin_inset space \thinspace{}
518 cm height and a proposed content:
519 \begin_inset VSpace defskip
523 \begin_inset Newline newline
527 \begin_inset Flex TextField
530 \begin_layout Plain Layout
531 \begin_inset Argument 1
534 \begin_layout Plain Layout
535 name=customer2, multiline, width=0.6
537 textwidth, height=3cm, value={Testman}
542 Enter your name here:
550 \begin_layout Standard
551 \begin_inset Note Greyedout
554 \begin_layout Plain Layout
559 It is highly recommended to use a uniform layout of all fields in a form.
561 \begin_inset space \thinspace{}
565 \begin_inset CommandInset ref
567 reference "sec:Form-element-customization"
579 \begin_layout Subsection
583 \begin_layout Standard
584 A check box is added by inserting the custom inset
589 Write inside the inset the label for the box.
591 \begin_inset Newline newline
595 \begin_inset Flex CheckBox
598 \begin_layout Plain Layout
599 \begin_inset Argument 1
602 \begin_layout Plain Layout
608 Are you older than 18 years?
616 \begin_layout Standard
617 You must specify also for check boxes a name.
619 \begin_inset space \thinspace{}
623 \begin_inset space \space{}
634 is the field name) into the
641 \begin_layout Subsection
645 \begin_layout Standard
646 A choice menu is added by inserting the custom inset
651 A label for the inset is added by using the menu
653 Insert\SpecialChar menuseparator
657 Insert the label text into this inset.
658 \begin_inset Newline newline
661 The different choices are inserted to the inset as comma-separated list.
669 \begin_layout Description
670 Radio Only one choice can be selected
673 \begin_layout Description
674 Combo The choices are listed in a combo box (dropdown list) but the user
675 is allowed to input something that is not in the predefined list.
678 \begin_layout Description
679 Popdown All choices are listed below each other.
680 If the field is not high enough a scroll bar is automatically added to
684 \begin_layout Standard
685 To determine the choice menu type one uses the parameter
700 \begin_layout Standard
701 Here is an example for the radio type:
702 \begin_inset VSpace defskip
706 \begin_inset Newline newline
710 \begin_inset Flex ChoiceMenu
713 \begin_layout Plain Layout
714 \begin_inset Argument 1
717 \begin_layout Plain Layout
724 \begin_inset Argument 2
727 \begin_layout Plain Layout
741 \begin_layout Standard
742 Here is an example for the combo type:
743 \begin_inset VSpace defskip
747 \begin_inset Newline newline
751 \begin_inset Flex ChoiceMenu
754 \begin_layout Plain Layout
755 \begin_inset Argument 1
758 \begin_layout Plain Layout
764 Albania=Al, Armenia=Ar, Azerbaidschan=Az
765 \begin_inset Argument 2
768 \begin_layout Plain Layout
782 \begin_layout Standard
783 Here is an example for the popdown type:
784 \begin_inset VSpace defskip
788 \begin_inset Newline newline
792 \begin_inset Flex ChoiceMenu
795 \begin_layout Plain Layout
796 \begin_inset Argument 1
799 \begin_layout Plain Layout
800 popdown, name=country
805 Albania=Al, Armenia=Ar, Azerbaidschan=Az
806 \begin_inset Argument 2
809 \begin_layout Plain Layout
823 \begin_layout Standard
824 You must also specify a name for choice menus.
825 Insert for example the parameter
833 is the name) into the
840 \begin_layout Standard
841 It is recommended to add a short name for every choice to be able to access
842 them and to know which one was chosen by the user.
843 This is done by adding
847 behind each choice (where
852 For example the radio type example contains this choice list:
858 \begin_inset Quotes eld
862 \begin_inset Quotes erd
865 you know that he chose the choice
866 \begin_inset Quotes eld
870 \begin_inset Quotes erd
874 With the name you can also preset/propose e.g.
875 \begin_inset space \space{}
879 \begin_inset Quotes eld
883 \begin_inset Quotes erd
886 by adding the parameter
894 \begin_layout Standard
895 \begin_inset Flex ChoiceMenu
898 \begin_layout Plain Layout
899 \begin_inset Argument 1
902 \begin_layout Plain Layout
903 radio, name=sex, default=m
909 \begin_inset Argument 2
912 \begin_layout Plain Layout
926 \begin_layout Subsection
930 \begin_layout Standard
931 A push button is added by inserting the custom inset
936 Write inside the inset the label for the button.
940 \begin_layout Standard
941 \begin_inset Flex PushButton
944 \begin_layout Plain Layout
945 \begin_inset Argument 1
948 \begin_layout Plain Layout
954 Don't click on this button or your fridge will be destroyed!!!
962 \begin_layout Standard
963 The action that is triggered by pressing the button is specified by JavaScript
965 To do this, add the parameter
969 and insert the JavaScript code between the braces.
970 For info about JavaScript, see its documentation,
971 \begin_inset CommandInset citation
978 In the following example this JavaScript code was used:
979 \begin_inset Newline newline
988 \begin_layout Plain Layout
995 What the hell? Now you destroyed your fridge.
1000 \begin_layout Plain Layout
1010 \begin_layout Standard
1011 \begin_inset Flex PushButton
1014 \begin_layout Plain Layout
1015 \begin_inset Argument 1
1018 \begin_layout Plain Layout
1023 \begin_layout Plain Layout
1030 What the hell? Now you destroyed your fridge.
1035 \begin_layout Plain Layout
1047 Don't click on this button or your fridge will be destroyed!!!
1055 \begin_layout Standard
1056 \begin_inset Note Greyedout
1059 \begin_layout Plain Layout
1064 All quote characters in form parameters must be inserted as \SpecialChar TeX
1073 \begin_layout Standard
1074 A common usage for push buttons is to open a weblink.
1075 Such a button is created by inserting a hyperlink into the
1083 \begin_layout Standard
1084 \begin_inset Flex PushButton
1087 \begin_layout Plain Layout
1088 \begin_inset Argument 1
1091 \begin_layout Plain Layout
1098 \begin_inset CommandInset href
1100 name "Information how to fill out this form"
1101 target "http://wiki.lyx.org"
1113 \begin_layout Standard
1114 To get rid of the special frame for weblinks add this to the additional
1115 options in the document settings under
1118 \begin_inset space ~
1126 \begin_layout Standard
1129 urlbordercolor={1 0 0}
1132 \begin_layout Standard
1133 if your push button border color is red (the default), otherwise use the
1134 same color definition as for your push button border color.
1137 \begin_layout Subsection
1139 \begin_inset CommandInset label
1141 name "subsec:Submit-button"
1148 \begin_layout Standard
1149 A submit button is used to submit the form data to a server.
1150 It is added by inserting the custom inset
1155 The label for the button is written into the inset.
1159 \begin_layout Standard
1160 \begin_inset Flex SubmitButton
1163 \begin_layout Plain Layout
1164 \begin_inset Argument 1
1167 \begin_layout Plain Layout
1173 Send your data via email
1181 \begin_layout Standard
1182 The submit button creates a forms data format (FDF) file (file extension
1183 *.fdf) which is then submitted.
1184 The FDF file contains only the form data.
1185 They can only be applied to a PDF form if all elements in the form have
1189 \begin_layout Standard
1190 \begin_inset Note Greyedout
1193 \begin_layout Plain Layout
1198 You can only use a submit button if you specified the submit method and
1199 a target in the inset
1202 \begin_inset space ~
1206 \begin_inset space ~
1212 \begin_inset space \thinspace{}
1216 \begin_inset CommandInset ref
1218 reference "sec:Preparation"
1222 for the description.
1223 If there are no specifications you will get \SpecialChar LaTeX
1232 \begin_layout Subsection
1236 \begin_layout Standard
1237 A reset button is used to reset all form elements to the initial state.
1238 It is added by inserting the custom inset
1243 The label for the button is written into the inset.
1247 \begin_layout Standard
1248 \begin_inset Flex ResetButton
1251 \begin_layout Plain Layout
1252 \begin_inset Argument 1
1255 \begin_layout Plain Layout
1269 \begin_layout Section
1270 Form element customization
1271 \begin_inset CommandInset label
1273 name "sec:Form-element-customization"
1280 \begin_layout Standard
1281 Since all form elements should look uniform, one can determine their layout
1282 using the following styles:
1285 \begin_layout Description
1287 \begin_inset space ~
1291 \begin_inset space ~
1297 \begin_layout Description
1299 \begin_inset space ~
1303 \begin_inset space ~
1309 \begin_layout Description
1311 \begin_inset space ~
1315 \begin_inset space ~
1318 Style affects all choice menu types
1321 \begin_layout Description
1323 \begin_inset space ~
1327 \begin_inset space ~
1330 Style affects only the combo box style
1333 \begin_layout Description
1335 \begin_inset space ~
1339 \begin_inset space ~
1342 Style affects only the popdown box style
1345 \begin_layout Description
1347 \begin_inset space ~
1351 \begin_inset space ~
1354 Style affects only the radio box style
1357 \begin_layout Description
1359 \begin_inset space ~
1363 \begin_inset space ~
1369 \begin_layout Description
1371 \begin_inset space ~
1375 \begin_inset space ~
1381 \begin_layout Description
1383 \begin_inset space ~
1387 \begin_inset space ~
1393 \begin_layout Text Field Style
1397 \begin_layout Standard
1398 The content of the styles is a comma-separated list of parameters.
1399 The possible parameters are listed in sec.
1400 \begin_inset space \thinspace{}
1404 \begin_inset Quotes eld
1407 Forms optional parameters
1408 \begin_inset Quotes erd
1411 of the documentation of the \SpecialChar LaTeX
1417 \begin_inset CommandInset citation
1424 It is important that the parameter
1428 is always part of the definition.
1429 Otherwise the fields will not appear in the PDF.
1430 The defined style is applied to all elements following the definition.
1433 \begin_layout Subsubsection*
1434 Here are some examples:
1437 \begin_layout Text Field Style
1438 print, bordercolor=red, borderstyle=U, backgroundcolor=lightgray, color=lime,
1439 maxlen=10, align=2, charsize=16pt
1442 \begin_layout Check Box Style
1443 print, borderstyle=S, checkboxsymbol=
1448 \begin_layout Combo Box Style
1449 print, bordercolor={0.33 0.66 0.33}, borderstyle=D
1452 \begin_layout Popdown Box Style
1456 \begin_layout Radio Box Style
1457 print, borderstyle=I, radiosymbol=3
1460 \begin_layout Push Button Style
1461 print, borderstyle=B, bordercolor=lime
1464 \begin_layout Submit Button Style
1465 print, borderwidth=0, bordercolor=white
1468 \begin_layout Reset Button Style
1469 print, bordercolor=lime
1472 \begin_layout Itemize
1473 Text field with gray background, lime text color, a red border only below
1474 the field, right alignment, 16
1475 \begin_inset space \thinspace{}
1478 pt font size and a limitation for maximal 10
1479 \begin_inset space ~
1482 characters to insert:
1483 \begin_inset VSpace defskip
1487 \begin_inset Newline newline
1491 \begin_inset Flex TextField
1494 \begin_layout Plain Layout
1495 \begin_inset Argument 1
1498 \begin_layout Plain Layout
1504 Enter your name here:
1512 \begin_layout Standard
1513 \begin_inset Note Greyedout
1516 \begin_layout Plain Layout
1529 custom background colors you must disable in these programs the highlighting
1532 \begin_inset Quotes eld
1535 Show border hover color for fields
1536 \begin_inset Quotes erd
1547 \begin_layout Standard
1548 \begin_inset Note Greyedout
1551 \begin_layout Plain Layout
1584 \begin_layout Itemize
1585 Check box with normal border and symbol
1588 \begin_inset VSpace defskip
1592 \begin_inset Newline newline
1596 \begin_inset Flex CheckBox
1599 \begin_layout Plain Layout
1600 \begin_inset Argument 1
1603 \begin_layout Plain Layout
1609 Are you older than 18 years?
1617 \begin_layout Standard
1618 The symbol is either specified as number or with the command
1619 \begin_inset Newline newline
1629 \begin_inset Newline newline
1636 is one of the possible numbers listed in Table
1637 \begin_inset space ~
1641 \begin_inset CommandInset citation
1650 \begin_layout Itemize
1651 Combo choice menu with dashed, colored border where the last entry is preselecte
1653 \begin_inset VSpace defskip
1657 \begin_inset Newline newline
1661 \begin_inset Flex ChoiceMenu
1664 \begin_layout Plain Layout
1665 \begin_inset Argument 1
1668 \begin_layout Plain Layout
1669 combo, name=combo2, default=Az
1674 Albania=Al, Armenia=Ar, Azerbaidschan=Az
1675 \begin_inset Argument 2
1678 \begin_layout Plain Layout
1692 \begin_layout Itemize
1693 Popdown choice menu where the second entry is preselected:
1694 \begin_inset VSpace defskip
1698 \begin_inset Newline newline
1702 \begin_inset Flex ChoiceMenu
1705 \begin_layout Plain Layout
1706 \begin_inset Argument 1
1709 \begin_layout Plain Layout
1710 popdown, name=country2, default=Ar
1715 Albania=Al, Armenia=Ar, Azerbaidschan=Az
1716 \begin_inset Argument 2
1719 \begin_layout Plain Layout
1733 \begin_layout Standard
1734 \begin_inset VSpace defskip
1738 \begin_inset Note Greyedout
1741 \begin_layout Plain Layout
1758 have no effect for popdown choice menus.
1766 \begin_layout Itemize
1767 Radio choice menu with inverted bevel border and symbol number
1768 \begin_inset space ~
1772 \begin_inset VSpace defskip
1776 \begin_inset Newline newline
1780 \begin_inset Flex ChoiceMenu
1783 \begin_layout Plain Layout
1784 \begin_inset Argument 1
1787 \begin_layout Plain Layout
1794 \begin_inset Argument 2
1797 \begin_layout Plain Layout
1811 \begin_layout Itemize
1812 Push button with a bevel border and colored text:
1813 \begin_inset VSpace defskip
1817 \begin_inset Newline newline
1821 \begin_inset Flex PushButton
1824 \begin_layout Plain Layout
1825 \begin_inset Argument 1
1828 \begin_layout Plain Layout
1833 \begin_layout Plain Layout
1840 Why do you click this?
1844 \begin_layout Plain Layout
1857 \begin_inset Box Frameless
1867 height_special "totalheight"
1872 backgroundcolor "lime"
1875 \begin_layout Plain Layout
1878 Don't click on this button!!!
1891 \begin_layout Standard
1892 \begin_inset VSpace defskip
1896 \begin_inset Note Greyedout
1899 \begin_layout Plain Layout
1920 have no effect for push, submit and reset buttons.
1928 \begin_layout Standard
1929 As workaround use a colored box and/or color the box text.
1932 \begin_layout Itemize
1933 Submit button without border, with cyan background and increased height:
1934 \begin_inset VSpace defskip
1938 \begin_inset Newline newline
1942 \begin_inset Flex SubmitButton
1945 \begin_layout Plain Layout
1946 \begin_inset Argument 1
1949 \begin_layout Plain Layout
1956 \begin_inset Box Frameless
1966 height_special "totalheight"
1971 backgroundcolor "cyan"
1974 \begin_layout Plain Layout
1975 Send your data via mail
1986 \begin_inset VSpace bigskip
1992 \begin_layout Itemize
1993 Reset button with a width of 7
1994 \begin_inset space \thinspace{}
1998 \begin_inset VSpace defskip
2002 \begin_inset Newline newline
2006 \begin_inset Flex ResetButton
2009 \begin_layout Plain Layout
2010 \begin_inset Argument 1
2013 \begin_layout Plain Layout
2020 \begin_inset Box Frameless
2030 height_special "totalheight"
2035 backgroundcolor "none"
2038 \begin_layout Plain Layout
2052 \begin_layout Standard
2053 \begin_inset Newpage newpage
2059 \begin_layout Section
2060 PDF viewer action buttons
2063 \begin_layout Standard
2064 One often needs basic actions to be done by the PDF viewer program.
2065 For example to print the form.
2066 Such PDF program-specific actions can be triggered by adding inserting
2080 can handle all possible actions while other PDF viewers might only support
2082 However, all PDF viewers support the basic things like printing, save
2083 \begin_inset space ~
2086 as, view in fullscreen etc..
2089 \begin_layout Standard
2090 To specify the action insert its name to the
2095 A list with possible action names can be found in sec.
2096 \begin_inset space \thinspace{}
2100 \begin_inset Quotes eld
2103 Acrobat-specific behavior
2104 \begin_inset Quotes erd
2107 of the documentation of the \SpecialChar LaTeX
2113 \begin_inset CommandInset citation
2122 \begin_layout Standard
2123 Here are some examples:
2126 \begin_layout Description
2128 \begin_inset Flex PDFAction
2131 \begin_layout Plain Layout
2132 \begin_inset Argument 1
2135 \begin_layout Plain Layout
2149 \begin_layout Description
2151 \begin_inset space ~
2155 \begin_inset Flex PDFAction
2158 \begin_layout Plain Layout
2159 \begin_inset Argument 1
2162 \begin_layout Plain Layout
2176 \begin_layout Description
2178 \begin_inset space ~
2182 \begin_inset space ~
2186 \begin_inset Flex PDFAction
2189 \begin_layout Plain Layout
2190 \begin_inset Argument 1
2193 \begin_layout Plain Layout
2199 View the form in fullscreen
2207 \begin_layout Subsection
2208 Action button customization
2209 \begin_inset CommandInset label
2211 name "subsec:Action-button-customization"
2218 \begin_layout Standard
2219 Customizing the action buttons requires the usage of boxes because things
2220 like the width, height and border separation cannot be specified as button
2224 \begin_layout Standard
2225 The easiest way to customize the buttons is to fill it with a custom box.
2226 For example the button should be 5
2227 \begin_inset space \thinspace{}
2230 cm wide and have the height of 2
2231 \begin_inset space ~
2235 Then create this parbox:
2238 \begin_layout Standard
2239 \begin_inset Box Frameless
2249 height_special "totalheight"
2254 backgroundcolor "none"
2257 \begin_layout Plain Layout
2267 \begin_layout Standard
2276 \begin_layout Standard
2277 \begin_inset Flex PDFAction
2280 \begin_layout Plain Layout
2281 \begin_inset Argument 1
2284 \begin_layout Plain Layout
2291 \begin_inset Box Frameless
2301 height_special "totalheight"
2306 backgroundcolor "none"
2309 \begin_layout Plain Layout
2323 \begin_layout PDF Link Setup
2325 \begin_inset Note Note
2328 \begin_layout Plain Layout
2329 Sets the thickness of the predefined link border to zero as described below.
2337 \begin_layout Standard
2338 To customize the border color, border thickness and the distance to the
2339 border one changes the border settings of the box.
2341 \begin_inset space \thinspace{}
2344 pt thick, teal border:
2345 \begin_inset Newline newline
2349 \begin_inset Flex PDFAction
2352 \begin_layout Plain Layout
2353 \begin_inset Argument 1
2356 \begin_layout Plain Layout
2363 \begin_inset Box Boxed
2373 height_special "totalheight"
2378 backgroundcolor "white"
2381 \begin_layout Plain Layout
2396 \begin_layout Standard
2397 To customize the border thickness, add the command
2401 to the additional options in the document settings under
2404 \begin_inset space ~
2413 with a number that is the thickness in pixels.
2414 If you want to change the border thickness only for certain buttons, use
2418 \begin_inset space ~
2422 \begin_inset space ~
2427 before the button and insert there the command
2432 The default value of
2443 \begin_layout Standard
2444 \begin_inset Note Greyedout
2447 \begin_layout Plain Layout
2456 affects all link types, not only the menu links.
2464 \begin_layout PDF Link Setup
2468 \begin_layout Standard
2470 \begin_inset space ~
2474 \begin_inset Newline newline
2478 \begin_inset Flex PDFAction
2481 \begin_layout Plain Layout
2482 \begin_inset Argument 1
2485 \begin_layout Plain Layout
2492 \begin_inset Box Frameless
2502 height_special "totalheight"
2507 backgroundcolor "none"
2510 \begin_layout Plain Layout
2525 \begin_layout Standard
2526 To change the border color use the command
2528 menubordercolor={r g b}
2542 are numbers between 0 and 1 for the colors red, green and blue.
2543 The default value of
2554 \begin_layout PDF Link Setup
2555 pdfborder={0 0 1}, menubordercolor={0.1 0.9 0.5}
2558 \begin_layout Standard
2561 menubordercolor={0.1 0.9 0.5}
2564 \begin_inset Newline newline
2568 \begin_inset Flex PDFAction
2571 \begin_layout Plain Layout
2572 \begin_inset Argument 1
2575 \begin_layout Plain Layout
2582 \begin_inset Box Frameless
2592 height_special "totalheight"
2597 backgroundcolor "none"
2600 \begin_layout Plain Layout
2615 \begin_layout Standard
2616 To change the background color use a colored box.
2619 \begin_layout PDF Link Setup
2623 \begin_layout Standard
2624 An example without a border and with lime background color:
2625 \begin_inset Newline newline
2629 \begin_inset Flex PDFAction
2632 \begin_layout Plain Layout
2633 \begin_inset Argument 1
2636 \begin_layout Plain Layout
2643 \begin_inset Box Frameless
2653 height_special "totalheight"
2658 backgroundcolor "lime"
2661 \begin_layout Plain Layout
2676 \begin_layout PDF Link Setup
2677 pdfborder={0 0 1}, menubordercolor={1 0 0}
2680 \begin_layout Section
2684 \begin_layout Standard
2685 It is also possible to have dynamic form fields.
2686 This means that depending on the actions of the user fields can (dis)appear
2687 or change their appearance.
2688 To use this feature, add these lines to your LaTeX preamble:
2691 \begin_layout Standard
2696 usepackage[pdftex]{insdljs}
2697 \begin_inset Newline newline
2711 \begin_layout Standard
2712 Then add the necessary JavaScript code to your document LaTeX preamble or
2714 code to your document.
2715 For info about JavaScript, see its documentation,
2716 \begin_inset CommandInset citation
2725 \begin_layout Standard
2729 \begin_layout Plain Layout
2739 \begin_inset Note Note
2742 \begin_layout Plain Layout
2743 The following section will only be displayed when the \SpecialChar LaTeX
2756 \begin_layout Standard
2757 For the following choice menu this JavaScript code was used:
2760 \begin_layout Standard
2761 \begin_inset listings
2762 lstparams "language=TeX"
2766 \begin_layout Plain Layout
2770 begin{insDLJS}[exaaae]{exaaae}{JavaScript}
2773 \begin_layout Plain Layout
2775 function validateTime(){
2778 \begin_layout Plain Layout
2783 \begin_layout Plain Layout
2785 if((event.value == "u") || (event.value == "unlimited")) {
2788 \begin_layout Plain Layout
2790 this.getField("from").display = display.hidden;
2793 \begin_layout Plain Layout
2795 this.getField("to").display = display.hidden;
2798 \begin_layout Plain Layout
2803 \begin_layout Plain Layout
2805 this.getField("from").display = display.visible;
2808 \begin_layout Plain Layout
2810 this.getField("to").display = display.visible;
2813 \begin_layout Plain Layout
2815 this.getField("from").setFocus();
2818 \begin_layout Plain Layout
2823 \begin_layout Plain Layout
2828 \begin_layout Plain Layout
2833 \begin_layout Plain Layout
2845 \begin_layout Standard
2846 \begin_inset Note Greyedout
2849 \begin_layout Plain Layout
2858 JavaScript functions must be inserted into the same
2870 \begin_layout Standard
2875 of the following choice menu are
2876 \begin_inset Newline newline
2881 name=contract,radio,default=tl,validate={validateTime();}
2884 \begin_layout Standard
2885 \begin_inset Flex ChoiceMenu
2888 \begin_layout Plain Layout
2889 \begin_inset Argument 1
2892 \begin_layout Plain Layout
2893 name=contract,radio,default=tl,validate={validateTime();}
2898 term-limited=tl, unlimited=u
2899 \begin_inset Argument 2
2902 \begin_layout Plain Layout
2914 \begin_inset VSpace defskip
2920 \begin_layout Standard
2921 \begin_inset Tabular
2922 <lyxtabular version="3" rows="3" columns="2">
2923 <features tabularvalignment="middle">
2924 <column alignment="left" valignment="top">
2925 <column alignment="center" valignment="top">
2927 <cell alignment="left" valignment="top" usebox="none">
2930 \begin_layout Plain Layout
2936 <cell alignment="center" valignment="top" usebox="none">
2939 \begin_layout Plain Layout
2940 \begin_inset Flex TextField
2943 \begin_layout Plain Layout
2944 \begin_inset Argument 1
2947 \begin_layout Plain Layout
2948 name=from,width=10em
2965 <cell alignment="center" valignment="top" usebox="none">
2968 \begin_layout Plain Layout
2974 <cell alignment="center" valignment="top" usebox="none">
2977 \begin_layout Plain Layout
2978 \begin_inset VSpace -1.5mm
2988 <cell alignment="left" valignment="top" usebox="none">
2991 \begin_layout Plain Layout
2997 <cell alignment="center" valignment="top" usebox="none">
3000 \begin_layout Plain Layout
3001 \begin_inset Flex TextField
3004 \begin_layout Plain Layout
3005 \begin_inset Argument 1
3008 \begin_layout Plain Layout
3032 \begin_layout Standard
3033 \begin_inset VSpace bigskip
3039 \begin_layout Standard
3040 To check and assure that the user only enters a number to a text field you
3041 can for example use this JavaScript code:
3044 \begin_layout Standard
3045 \begin_inset listings
3046 lstparams "language=TeX"
3050 \begin_layout Plain Layout
3052 function checkNumber() {
3055 \begin_layout Plain Layout
3060 \begin_layout Plain Layout
3062 if (!Number(event.value)) {
3065 \begin_layout Plain Layout
3067 app.alert("Value must be a number!");
3070 \begin_layout Plain Layout
3075 \begin_layout Plain Layout
3080 \begin_layout Plain Layout
3082 event.target.textColor = color.green;
3085 \begin_layout Plain Layout
3095 \begin_layout Standard
3096 An example text field:
3097 \begin_inset Flex TextField
3100 \begin_layout Plain Layout
3101 \begin_inset Argument 1
3104 \begin_layout Plain Layout
3105 name=onlyNumbers, align=1, validate={checkNumber();}
3118 \begin_layout Standard
3122 \begin_layout Plain Layout
3132 \begin_inset Note Note
3135 \begin_layout Plain Layout
3136 The following will be displayed when the \SpecialChar LaTeX
3149 \begin_layout Standard
3150 You need to install the package
3154 to see the content of this section in the output.
3157 \begin_layout Standard
3161 \begin_layout Plain Layout
3173 \begin_layout End PDF Form
3174 \begin_inset Note Note
3177 \begin_layout Plain Layout
3186 \begin_layout Section
3190 \begin_layout Itemize
3191 Submitting and applying data requires that all form elements have a name.
3194 \begin_layout Itemize
3195 All braces, brackets, backslashes and quote characters in form parameters
3196 must be inserted as \SpecialChar TeX
3200 \begin_layout Itemize
3201 Creating a PDF form requires pdflatex or lualatex.
3202 Use therefore either the \SpecialChar LyX
3209 PDF (Lua\SpecialChar TeX
3215 \begin_layout Itemize
3224 custom background colors you must disable in these programs the highlighting
3227 \begin_inset Quotes eld
3230 Show border hover color for fields
3231 \begin_inset Quotes erd
3237 \begin_layout Bibliography
3238 \begin_inset CommandInset bibitem
3239 LatexCommand bibitem
3245 \begin_inset CommandInset href
3247 name "JavaScript reference"
3248 target "https://developer.mozilla.org/en/docs/Web/JavaScript/Reference"
3255 \begin_layout Bibliography
3256 \begin_inset CommandInset bibitem
3257 LatexCommand bibitem
3263 \begin_inset CommandInset href
3265 name "Documentation"
3266 target "http://mirrors.ctan.org/macros/latex/contrib/hyperref/doc/manual.pdf"
3270 of the \SpecialChar LaTeX
3276 \begin_layout Bibliography
3277 \begin_inset CommandInset bibitem
3278 LatexCommand bibitem
3284 \begin_inset CommandInset href
3286 name "Documentation"
3287 target "http://mirrors.ctan.org/macros/latex/required/psnfss/psnfss2e.pdf"
3291 of the \SpecialChar LaTeX