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 {\setboolean{insdljs}{false}}
20 \pdfcatalog{/AA \the\pdflastobj\space 0 R}
22 \ifinsdljs % only execute if package insdljs is installed
24 \begin{insDLJS}[exaaae]{exaaae}{JavaScript}
26 function validateTime(){
28 if((event.value == "u") || (event.value == "unlimited")) {
29 this.getField("from").display = display.hidden;
30 this.getField("to").display = display.hidden;
32 this.getField("from").display = display.visible;
33 this.getField("to").display = display.visible;
34 this.getField("from").setFocus();
39 function checkNumber() {
41 if (!Number(event.value))
43 app.alert("Value must be a number!");
46 event.target.textColor = color.green;
59 % set fonts for nicer pdf view
60 \IfFileExists{lmodern.sty}
61 {\usepackage{lmodern}}{}
63 \fi % end if pdflatex is used
65 \options BCOR8mm,pagesize
66 \use_default_options false
70 \maintain_unincluded_children false
72 \language_package default
75 \font_roman "default" "default"
76 \font_sans "default" "default"
77 \font_typewriter "default" "default"
78 \font_math "auto" "auto"
79 \font_default_family default
80 \use_non_tex_fonts false
83 \font_sf_scale 100 100
84 \font_tt_scale 100 100
86 \default_output_format pdf2
88 \bibtex_command bibtex
89 \index_command default
93 \pdf_title "Description of the module pdfcomment"
94 \pdf_author "Uwe Stöhr"
95 \pdf_subject "PDF form"
96 \pdf_keywords "LyX, PDF forms, hyperref"
98 \pdf_bookmarksnumbered true
99 \pdf_bookmarksopen true
100 \pdf_bookmarksopenlevel 2
101 \pdf_breaklinks false
103 \pdf_colorlinks false
105 \pdf_pdfusetitle false
106 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue, pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false, urlbordercolor={1 0 0}"
109 \use_package amsmath 1
110 \use_package amssymb 1
111 \use_package cancel 0
113 \use_package mathdots 1
114 \use_package mathtools 1
115 \use_package mhchem 1
116 \use_package stackrel 0
117 \use_package stmaryrd 0
118 \use_package undertilde 0
120 \cite_engine_type default
124 \paperorientation portrait
128 \notefontcolor #0000ff
135 \paragraph_separation skip
137 \quotes_language english
140 \paperpagestyle default
141 \tracking_changes false
142 \output_changes false
145 \html_be_strict false
150 \begin_layout Begin PDF Form
151 \begin_inset Argument 1
154 \begin_layout Plain Layout
155 action=mailto:forms@lyx.test?subject=The submitted PDF form, method=post
164 Description of the module PDF Form
171 \begin_layout Standard
172 \begin_inset Note Note
175 \begin_layout Plain Layout
176 To export all parts of this document to PDF the \SpecialChar LaTeX
182 If it is not installed you can export the document anyway but the example
183 in the section about dynamic form fields won't appear in the output.
191 \begin_layout Standard
192 By loading the module PDF
196 Form the whole document or a part of it can be made a PDF form.
197 You can add all possible form elements like text fields buttons etc.
198 This document describes how this is done.
201 \begin_layout Section
203 \begin_inset CommandInset label
205 name "sec:Preparation"
212 \begin_layout Standard
213 At first load the module PDF
217 Form in the document settings of your file.
218 To make the whole document a form, insert the environment
230 from \SpecialChar LyX
231 's dropdown menu at the beginning of the document.
232 If only a part of the document should be a form, add
244 at the position where the form should start.
247 \begin_layout Standard
248 \begin_inset Note Greyedout
251 \begin_layout Plain Layout
256 It is only possible to have one form in a PDF file!
264 \begin_layout Standard
265 If the form data should be submitted to a server or the like, then you must
266 specify the URL as parameter of the
279 This is done by using the menu
281 Insert\SpecialChar menuseparator
293 For example in this document the following was inserted to the parameter
297 \begin_layout Standard
300 action=mailto:forms@lyx.test?subject=The submitted PDF form,
301 \begin_inset Newline newline
307 \begin_layout Standard
308 This sends the form data as email to
312 when the user presses the submit button.
313 The email subject will be
314 \begin_inset Quotes eld
317 The submitted PDF form
318 \begin_inset Quotes erd
321 and the HTML method is
326 (The other possible method would be
330 .) For more about submitting see sec.
331 \begin_inset space \thinspace{}
335 \begin_inset CommandInset ref
337 reference "subsec:Submit-button"
344 \begin_layout Standard
345 \begin_inset Newpage newpage
351 \begin_layout Section
355 \begin_layout Standard
360 possible types of fields in a PDF form:
363 \begin_layout Subsection
367 \begin_layout Standard
368 A text field is added by inserting the custom inset
374 Insert\SpecialChar menuseparator
382 Write inside the inset the label for the text field that will be printed
383 in the PDF output before the field.
385 \begin_inset Newline newline
389 \begin_inset Flex TextField
392 \begin_layout Plain Layout
393 \begin_inset Argument 1
396 \begin_layout Plain Layout
402 Enter your name here:
410 \begin_layout Standard
411 You must also specify a field name for text fields: Set the cursor into
417 There insert for example the parameter
428 \begin_layout Standard
429 Using the same name for several text fields results in an automatic duplication
430 of the inserted text.
431 This is for example useful if the user should input a date that should
432 appear at different places in the form.
433 \begin_inset Newline newline
440 fields as example: Fill one and see that the other one will also be filled
442 \begin_inset Newline newline
446 \begin_inset Flex TextField
449 \begin_layout Plain Layout
450 \begin_inset Argument 1
453 \begin_layout Plain Layout
465 \begin_inset Newline newline
469 \begin_inset Flex TextField
472 \begin_layout Plain Layout
473 \begin_inset Argument 1
476 \begin_layout Plain Layout
490 \begin_layout Standard
491 All form fields can be customized by adding parameters.
494 \begin_layout Standard
495 Here is a customized multiline text field with a width of 60
496 \begin_inset space \thinspace{}
499 % of the text width, 3
500 \begin_inset space \thinspace{}
503 cm height and a proposed content:
504 \begin_inset VSpace defskip
508 \begin_inset Newline newline
512 \begin_inset Flex TextField
515 \begin_layout Plain Layout
516 \begin_inset Argument 1
519 \begin_layout Plain Layout
520 name=customer2, multiline, width=0.6
522 textwidth, height=3cm, value={Testman}
527 Enter your name here:
535 \begin_layout Standard
536 \begin_inset Note Greyedout
539 \begin_layout Plain Layout
544 It is highly recommended to use a uniform layout of all fields in your
547 \begin_inset space \thinspace{}
551 \begin_inset CommandInset ref
553 reference "sec:Form-field-customization"
557 for how this is done.
565 \begin_layout Subsection
569 \begin_layout Standard
570 A check box is added by inserting the custom inset
575 Write inside the inset the label for the box.
577 \begin_inset Newline newline
581 \begin_inset Flex CheckBox
584 \begin_layout Plain Layout
585 \begin_inset Argument 1
588 \begin_layout Plain Layout
594 Are you older than 18 years?
602 \begin_layout Standard
603 You must also specify a field name for check boxes: Insert for example the
612 is the field name) into the
619 \begin_layout Subsection
623 \begin_layout Standard
624 A choice menu is added by inserting the custom inset
629 A label for the inset is added by using the menu
631 Insert\SpecialChar menuseparator
635 Insert the label text into this inset.
636 \begin_inset Newline newline
639 The different choices are inserted to the inset as comma-separated list.
647 \begin_layout Description
648 Radio Only one choice can be selected
651 \begin_layout Description
652 Combo The choices are listed in a combo box (dropdown list) but the user
653 is allowed to choose something that is not in the predefined list.
656 \begin_layout Description
657 Popdown All choices are listed below each other.
658 It the filed is not high enough a scroll bar is automatically added to
662 \begin_layout Standard
663 To determine the choice menu type, add the parameter
678 \begin_layout Standard
679 Here is an example for the radio type:
680 \begin_inset VSpace defskip
684 \begin_inset Newline newline
688 \begin_inset Flex ChoiceMenu
691 \begin_layout Plain Layout
692 \begin_inset Argument 1
695 \begin_layout Plain Layout
702 \begin_inset Argument 2
705 \begin_layout Plain Layout
719 \begin_layout Standard
720 Here is an example for the combo type:
721 \begin_inset VSpace defskip
725 \begin_inset Newline newline
729 \begin_inset Flex ChoiceMenu
732 \begin_layout Plain Layout
733 \begin_inset Argument 1
736 \begin_layout Plain Layout
742 Albania=Al, Armenia=Ar, Azerbaidschan=Az
743 \begin_inset Argument 2
746 \begin_layout Plain Layout
760 \begin_layout Standard
761 Here is an example for the popdown type:
762 \begin_inset VSpace defskip
766 \begin_inset Newline newline
770 \begin_inset Flex ChoiceMenu
773 \begin_layout Plain Layout
774 \begin_inset Argument 1
777 \begin_layout Plain Layout
778 popdown, name=country
783 Albania=Al, Armenia=Ar, Azerbaidschan=Az
784 \begin_inset Argument 2
787 \begin_layout Plain Layout
801 \begin_layout Standard
802 You must also specify a field name for choice menus: Insert for example
811 is the field name) into the
818 \begin_layout Standard
819 It is recommended to add a short name for every choice to be able to access
820 them and to know which one was chosen by the user.
821 This is done by adding
825 behind each choice (where
830 For example the radio type example contains this choice list:
836 \begin_inset Quotes eld
840 \begin_inset Quotes erd
843 you know that he chose the choice
844 \begin_inset Quotes eld
848 \begin_inset Quotes erd
852 By specifying names you can also preset/propose e.g.
853 \begin_inset space \space{}
857 \begin_inset Quotes eld
861 \begin_inset Quotes erd
864 by adding the parameter
872 \begin_layout Standard
873 \begin_inset Flex ChoiceMenu
876 \begin_layout Plain Layout
877 \begin_inset Argument 1
880 \begin_layout Plain Layout
881 radio, name=sex, default=m
887 \begin_inset Argument 2
890 \begin_layout Plain Layout
904 \begin_layout Standard
905 \begin_inset Note Greyedout
908 \begin_layout Plain Layout
913 Due to a bug in the \SpecialChar LaTeX
918 it is currently only possible the set the first choice as default.
926 \begin_layout Standard
927 \begin_inset Newpage newpage
933 \begin_layout Subsection
937 \begin_layout Standard
938 A push button is added by inserting the custom inset
943 Write inside the inset the label for the button.
947 \begin_layout Standard
948 \begin_inset Flex PushButton
951 \begin_layout Plain Layout
952 \begin_inset Argument 1
955 \begin_layout Plain Layout
961 Don't click on this button or your fridge will be destroyed!!!
969 \begin_layout Standard
970 The action that is triggered by pressing the button is specified by JavaScript
972 To specify it, add the parameter
976 and insert the JavaScript code between the braces.
977 For info about JavaScript, see its documentation,
978 \begin_inset CommandInset citation
985 In the following example this JavaScript code was used:
986 \begin_inset Newline newline
995 \begin_layout Plain Layout
1002 What the hell? Now you destroyed your fridge.
1007 \begin_layout Plain Layout
1017 \begin_layout Standard
1018 \begin_inset Flex PushButton
1021 \begin_layout Plain Layout
1022 \begin_inset Argument 1
1025 \begin_layout Plain Layout
1030 \begin_layout Plain Layout
1037 What the hell? Now you destroyed your fridge.
1042 \begin_layout Plain Layout
1054 Don't click on this button or your fridge will be destroyed!!!
1062 \begin_layout Standard
1063 \begin_inset Note Greyedout
1066 \begin_layout Plain Layout
1071 All quote characters in form parameters must be inserted as \SpecialChar TeX
1080 \begin_layout Standard
1081 A common usage for pus buttons is to open a weblink.
1082 Such a button is created by inserting a hyperlink into the button inset.
1086 \begin_layout Standard
1087 \begin_inset Flex PushButton
1090 \begin_layout Plain Layout
1091 \begin_inset Argument 1
1094 \begin_layout Plain Layout
1101 \begin_inset CommandInset href
1103 name "Information how to fill out this form"
1104 target "http://wiki.lyx.org"
1116 \begin_layout Standard
1117 To get rid of the frame for weblinks add this to the additional options
1118 in the document settings under
1121 \begin_inset space ~
1129 \begin_layout Standard
1132 urlbordercolor={1 0 0}
1135 \begin_layout Standard
1136 if your push button border color is red (the default), otherwise use the
1137 same color definition as for your push button border color.
1140 \begin_layout Subsection
1142 \begin_inset CommandInset label
1144 name "subsec:Submit-button"
1151 \begin_layout Standard
1152 A submit button is used to submit the form data to a server.
1153 It is added by inserting the custom inset
1158 Write inside the inset the label for the button.
1162 \begin_layout Standard
1163 \begin_inset Flex SubmitButton
1166 \begin_layout Plain Layout
1167 \begin_inset Argument 1
1170 \begin_layout Plain Layout
1176 Send your data via email
1184 \begin_layout Standard
1185 The submit button creates a forms data format (FDF) file (file extension
1186 *.fdf) which is then submitted.
1187 The FDF file contains only the form data.
1188 They can only be applied to a PDF form if all fields in the form have a
1192 \begin_layout Standard
1193 \begin_inset Note Greyedout
1196 \begin_layout Plain Layout
1201 You can only use a submit button if you specified the submit method and
1202 target in the PDF form environment options! See sec.
1203 \begin_inset space \thinspace{}
1207 \begin_inset CommandInset ref
1209 reference "sec:Preparation"
1213 for the description.
1214 If there are no specifications you will get \SpecialChar LaTeX
1223 \begin_layout Standard
1224 \begin_inset Note Greyedout
1227 \begin_layout Plain Layout
1232 If you have more than one submit button in your document you must specify
1233 a name for each of them to avoid \SpecialChar LaTeX
1234 errors! For example add
1242 is the button name).
1250 \begin_layout Subsection
1254 \begin_layout Standard
1255 A reset button is used to reset all form fields to the initial state.
1256 It is added by inserting the custom inset
1261 Write inside the inset the label for the button.
1265 \begin_layout Standard
1266 \begin_inset Flex ResetButton
1269 \begin_layout Plain Layout
1270 \begin_inset Argument 1
1273 \begin_layout Plain Layout
1287 \begin_layout Standard
1288 \begin_inset Note Greyedout
1291 \begin_layout Plain Layout
1296 If you have more than one reset button in your document you must specify
1297 a name for each of them to avoid \SpecialChar LaTeX
1298 errors! For example add
1306 is the button name).
1314 \begin_layout Section
1315 Form field customization
1316 \begin_inset CommandInset label
1318 name "sec:Form-field-customization"
1325 \begin_layout Standard
1326 Since all form elements should look uniform, one can determine their layout
1327 using the following styles:
1330 \begin_layout Description
1332 \begin_inset space ~
1336 \begin_inset space ~
1342 \begin_layout Description
1344 \begin_inset space ~
1348 \begin_inset space ~
1354 \begin_layout Description
1356 \begin_inset space ~
1360 \begin_inset space ~
1363 Style affects all choice menu types
1366 \begin_layout Description
1368 \begin_inset space ~
1372 \begin_inset space ~
1375 Style affects only the combo box style
1378 \begin_layout Description
1380 \begin_inset space ~
1384 \begin_inset space ~
1387 Style affects only the popdown box style
1390 \begin_layout Description
1392 \begin_inset space ~
1396 \begin_inset space ~
1399 Style affects only the radio box style
1402 \begin_layout Description
1404 \begin_inset space ~
1408 \begin_inset space ~
1414 \begin_layout Description
1416 \begin_inset space ~
1420 \begin_inset space ~
1426 \begin_layout Description
1428 \begin_inset space ~
1432 \begin_inset space ~
1438 \begin_layout Text Field Style
1442 \begin_layout Standard
1443 The content of the styles is a comma-separated list of parameters.
1444 The possible parameters are listed in sec.
1445 \begin_inset space \thinspace{}
1449 \begin_inset Quotes eld
1452 Forms optional parameters
1453 \begin_inset Quotes erd
1456 of the documentation of the \SpecialChar LaTeX
1462 \begin_inset CommandInset citation
1469 It is important that the parameter print is always part of the definition,
1470 otherwise the fields won't appear in the PDF output.
1471 The defined style is applied to all fields following the definition.
1474 \begin_layout Subsubsection*
1475 Here are some examples:
1478 \begin_layout Text Field Style
1479 print, bordercolor=red, borderstyle=U, backgroundcolor=lightgray, color=lime,
1480 maxlen=10, align=2, charsize=16pt
1483 \begin_layout Check Box Style
1484 print, borderstyle=S, checkboxsymbol=
1489 \begin_layout Combo Box Style
1490 print, bordercolor={0.33 0.66 0.33}, borderstyle=D
1493 \begin_layout Popdown Box Style
1497 \begin_layout Radio Box Style
1498 print, borderstyle=I, radiosymbol=6
1501 \begin_layout Push Button Style
1502 print, borderstyle=B, bordercolor=lime
1505 \begin_layout Submit Button Style
1506 print, borderwidth=0, bordercolor=white
1509 \begin_layout Reset Button Style
1510 print, bordercolor=lime
1513 \begin_layout Itemize
1514 Text field with gray background, lime text color, a red border only below
1515 the field, right alignment, 16
1516 \begin_inset space \thinspace{}
1519 pt font size and a limitation for maximal 10
1520 \begin_inset space ~
1523 characters to insert:
1524 \begin_inset VSpace defskip
1528 \begin_inset Newline newline
1532 \begin_inset Flex TextField
1535 \begin_layout Plain Layout
1536 \begin_inset Argument 1
1539 \begin_layout Plain Layout
1545 Enter your name here:
1553 \begin_layout Standard
1581 \begin_layout Standard
1582 \begin_inset Note Greyedout
1585 \begin_layout Plain Layout
1594 has only an effect for text fields if a
1606 \begin_layout Itemize
1607 Check box with normal border and symbol
1610 \begin_inset VSpace defskip
1614 \begin_inset Newline newline
1618 \begin_inset Flex CheckBox
1621 \begin_layout Plain Layout
1622 \begin_inset Argument 1
1625 \begin_layout Plain Layout
1631 Are you older than 18 years?
1639 \begin_layout Standard
1640 The symbol is either specified as number or with the command
1641 \begin_inset Newline newline
1651 \begin_inset Newline newline
1658 is one of the possible numbers listed in Table
1659 \begin_inset space ~
1663 \begin_inset CommandInset citation
1672 \begin_layout Itemize
1673 Combo box with dashed, colored border:
1674 \begin_inset VSpace defskip
1678 \begin_inset Newline newline
1682 \begin_inset Flex ChoiceMenu
1685 \begin_layout Plain Layout
1686 \begin_inset Argument 1
1689 \begin_layout Plain Layout
1690 combo, name=combo2, default=Az
1695 Albania=Al, Armenia=Ar, Azerbaidschan=Az
1696 \begin_inset Argument 2
1699 \begin_layout Plain Layout
1713 \begin_layout Itemize
1714 Popdown box where only 2
1715 \begin_inset space ~
1718 entries are shown and where the last entry is preselected:
1719 \begin_inset VSpace defskip
1723 \begin_inset Newline newline
1727 \begin_inset Flex ChoiceMenu
1730 \begin_layout Plain Layout
1731 \begin_inset Argument 1
1734 \begin_layout Plain Layout
1735 popdown, name=country2, value=Az
1740 Albania=Al, Armenia=Ar, Azerbaidschan=Az
1741 \begin_inset Argument 2
1744 \begin_layout Plain Layout
1758 \begin_layout Standard
1759 \begin_inset VSpace defskip
1763 \begin_inset Note Greyedout
1766 \begin_layout Plain Layout
1783 has no effect for popdown boxes.
1791 \begin_layout Itemize
1792 Radio box with inverted bevel border and symbol number
1793 \begin_inset space ~
1797 \begin_inset VSpace defskip
1801 \begin_inset Newline newline
1805 \begin_inset Flex ChoiceMenu
1808 \begin_layout Plain Layout
1809 \begin_inset Argument 1
1812 \begin_layout Plain Layout
1819 \begin_inset Argument 2
1822 \begin_layout Plain Layout
1836 \begin_layout Itemize
1837 Push button with a bevel border and colored text:
1838 \begin_inset VSpace defskip
1842 \begin_inset Newline newline
1846 \begin_inset Flex PushButton
1849 \begin_layout Plain Layout
1850 \begin_inset Argument 1
1853 \begin_layout Plain Layout
1858 \begin_layout Plain Layout
1865 Why do you click this?
1869 \begin_layout Plain Layout
1882 \begin_inset Box Frameless
1892 height_special "totalheight"
1897 backgroundcolor "lime"
1900 \begin_layout Plain Layout
1903 Don't click on this button!!!
1916 \begin_layout Standard
1917 \begin_inset VSpace defskip
1921 \begin_inset Note Greyedout
1924 \begin_layout Plain Layout
1937 has no effect for push, submit and reset buttons.
1945 \begin_layout Standard
1946 As workaround use a colored box and/or color the box text.
1949 \begin_layout Standard
1950 \begin_inset Note Greyedout
1953 \begin_layout Plain Layout
1966 has no effect for push, submit and reset buttons.
1974 \begin_layout Standard
1975 As workaround a box.
1978 \begin_layout Itemize
1979 Submit button without border, with cyan background color and increased height:
1980 \begin_inset VSpace defskip
1984 \begin_inset Newline newline
1988 \begin_inset Flex SubmitButton
1991 \begin_layout Plain Layout
1992 \begin_inset Argument 1
1995 \begin_layout Plain Layout
2002 \begin_inset Box Frameless
2012 height_special "totalheight"
2017 backgroundcolor "cyan"
2020 \begin_layout Plain Layout
2021 Send your data via mail
2032 \begin_inset VSpace bigskip
2038 \begin_layout Itemize
2039 Reset button with a width of 7
2040 \begin_inset space \thinspace{}
2044 \begin_inset VSpace defskip
2048 \begin_inset Newline newline
2052 \begin_inset Flex ResetButton
2055 \begin_layout Plain Layout
2056 \begin_inset Argument 1
2059 \begin_layout Plain Layout
2066 \begin_inset Box Frameless
2076 height_special "totalheight"
2081 backgroundcolor "none"
2084 \begin_layout Plain Layout
2098 \begin_layout Section
2099 PDF viewer action buttons
2102 \begin_layout Standard
2103 One often needs basic actions to be done by the PDF viewer program.
2104 For example to print the form.
2105 Such PDF program-specific actions can be triggered by adding inserting
2111 The PDF viewer programs
2119 can handle all possible actions while other PDF viewers might only support
2121 However, all PDF viewer programs support the basic things like printing,
2123 \begin_inset space ~
2126 as, view in fullscreen etc..
2129 \begin_layout Standard
2130 To specify the action insert its name to the
2135 A list with possible actions can be found in sec.
2136 \begin_inset space \thinspace{}
2140 \begin_inset Quotes eld
2143 Acrobat-specific behavior
2144 \begin_inset Quotes erd
2147 of the documentation of the \SpecialChar LaTeX
2153 \begin_inset CommandInset citation
2162 \begin_layout Standard
2163 Here are some examples:
2166 \begin_layout Description
2168 \begin_inset Flex PDFAction
2171 \begin_layout Plain Layout
2172 \begin_inset Argument 1
2175 \begin_layout Plain Layout
2189 \begin_layout Description
2191 \begin_inset space ~
2195 \begin_inset Flex PDFAction
2198 \begin_layout Plain Layout
2199 \begin_inset Argument 1
2202 \begin_layout Plain Layout
2216 \begin_layout Description
2218 \begin_inset space ~
2222 \begin_inset space ~
2226 \begin_inset Flex PDFAction
2229 \begin_layout Plain Layout
2230 \begin_inset Argument 1
2233 \begin_layout Plain Layout
2239 View the form in fullscreen
2247 \begin_layout Subsection
2248 Action button customization
2249 \begin_inset CommandInset label
2251 name "subsec:Action-button-customization"
2258 \begin_layout Standard
2259 Customizing the action buttons requires the usage of boxes because things
2260 like the width, height and border separation cannot be specified as button
2264 \begin_layout Standard
2265 The easiest way to customize the buttons is to fill it with a custom box.
2266 For example the button should be 4
2267 \begin_inset space \thinspace{}
2270 cm wide and have the height of 2 lines.
2271 Then create this parbox:
2274 \begin_layout Standard
2275 \begin_inset Box Frameless
2285 height_special "totalheight"
2290 backgroundcolor "none"
2293 \begin_layout Plain Layout
2303 \begin_layout Standard
2312 \begin_layout Standard
2313 \begin_inset Flex PDFAction
2316 \begin_layout Plain Layout
2317 \begin_inset Argument 1
2320 \begin_layout Plain Layout
2327 \begin_inset Box Frameless
2337 height_special "totalheight"
2342 backgroundcolor "none"
2345 \begin_layout Plain Layout
2359 \begin_layout Standard
2360 To customize the border color, add the command
2362 menubordercolor={r g b}
2364 to the additional options in the document settings under
2367 \begin_inset space ~
2384 with a number between 0 and 1 for the colors red, green and blue.
2385 If you want to change the border color only for certain buttons, use the
2389 \begin_inset space ~
2393 \begin_inset space ~
2398 before the button and insert there the command
2403 The default value of
2414 \begin_layout PDF Link Setup
2415 menubordercolor={0.1 0.9 0.5}
2418 \begin_layout Standard
2421 menubordercolor={0.1 0.9 0.5}
2424 \begin_inset Newline newline
2428 \begin_inset Flex PDFAction
2431 \begin_layout Plain Layout
2432 \begin_inset Argument 1
2435 \begin_layout Plain Layout
2442 \begin_inset Box Frameless
2452 height_special "totalheight"
2457 backgroundcolor "none"
2460 \begin_layout Plain Layout
2475 \begin_layout Standard
2476 To change the border width use the command
2484 is the width in pixels.
2485 The default value of
2496 \begin_layout Standard
2497 \begin_inset Note Greyedout
2500 \begin_layout Plain Layout
2509 affects all link types, not only the menu links.
2517 \begin_layout PDF Link Setup
2518 pdfborder={0 0 4}, menubordercolor={1 1 0}
2521 \begin_layout Standard
2523 \begin_inset space ~
2526 pixel thick yellow border:
2527 \begin_inset Newline newline
2531 \begin_inset Flex PDFAction
2534 \begin_layout Plain Layout
2535 \begin_inset Argument 1
2538 \begin_layout Plain Layout
2545 \begin_inset Box Frameless
2555 height_special "totalheight"
2560 backgroundcolor "none"
2563 \begin_layout Plain Layout
2578 \begin_layout Standard
2579 To change the background color use a colored box.
2582 \begin_layout PDF Link Setup
2586 \begin_layout Standard
2587 An example without a border and with lime background color:
2588 \begin_inset Newline newline
2592 \begin_inset Flex PDFAction
2595 \begin_layout Plain Layout
2596 \begin_inset Argument 1
2599 \begin_layout Plain Layout
2606 \begin_inset Box Frameless
2616 height_special "totalheight"
2621 backgroundcolor "lime"
2624 \begin_layout Plain Layout
2639 \begin_layout PDF Link Setup
2640 pdfborder={0 0 1}, menubordercolor={1 0 0}
2643 \begin_layout Section
2647 \begin_layout Standard
2648 It is also possible to have dynamic form fields.
2649 This means that depending on the actions of the user fields can (dis)appear
2650 or change their appearance.
2651 To use this feature, add these lines to your document preamble:
2654 \begin_layout Standard
2659 usepackage[pdftex]{insdljs}
2660 \begin_inset Newline newline
2674 \begin_layout Standard
2675 Then add the necessary JavaScript code to your document \SpecialChar LaTeX
2678 code to your document.
2679 For info about JavaScript, see its documentation,
2680 \begin_inset CommandInset citation
2689 \begin_layout Standard
2693 \begin_layout Plain Layout
2703 \begin_inset Note Note
2706 \begin_layout Plain Layout
2707 The following section will only be displayed when the \SpecialChar LaTeX
2720 \begin_layout Standard
2721 For the following choice menu this JavaScript code was used:
2724 \begin_layout Standard
2725 \begin_inset listings
2726 lstparams "language=TeX"
2730 \begin_layout Plain Layout
2734 begin{insDLJS}[exaaae]{exaaae}{JavaScript}
2737 \begin_layout Plain Layout
2739 function validateTime(){
2742 \begin_layout Plain Layout
2747 \begin_layout Plain Layout
2749 if((event.value == "u") || (event.value == "unlimited")) {
2752 \begin_layout Plain Layout
2754 this.getField("from").display = display.hidden;
2757 \begin_layout Plain Layout
2759 this.getField("to").display = display.hidden;
2762 \begin_layout Plain Layout
2767 \begin_layout Plain Layout
2769 this.getField("from").display = display.visible;
2772 \begin_layout Plain Layout
2774 this.getField("to").display = display.visible;
2777 \begin_layout Plain Layout
2779 this.getField("from").setFocus();
2782 \begin_layout Plain Layout
2787 \begin_layout Plain Layout
2792 \begin_layout Plain Layout
2797 \begin_layout Plain Layout
2809 \begin_layout Standard
2810 \begin_inset Note Greyedout
2813 \begin_layout Plain Layout
2822 JavaScript funtions must be inserted into the same
2834 \begin_layout Standard
2838 \begin_inset space ~
2842 \begin_inset space ~
2847 of the following choice menu are
2848 \begin_inset Newline newline
2853 name=contract,radio,default=tl,validate={validateTime();}
2856 \begin_layout Standard
2857 \begin_inset Flex ChoiceMenu
2860 \begin_layout Plain Layout
2861 \begin_inset Argument 1
2864 \begin_layout Plain Layout
2865 name=contract,radio,default=tl,validate={validateTime();}
2870 term-limited=tl, unlimited=u
2871 \begin_inset Argument 2
2874 \begin_layout Plain Layout
2886 \begin_inset VSpace defskip
2892 \begin_layout Standard
2893 \begin_inset Tabular
2894 <lyxtabular version="3" rows="3" columns="2">
2895 <features tabularvalignment="middle">
2896 <column alignment="left" valignment="top">
2897 <column alignment="center" valignment="top">
2899 <cell alignment="left" valignment="top" usebox="none">
2902 \begin_layout Plain Layout
2908 <cell alignment="center" valignment="top" usebox="none">
2911 \begin_layout Plain Layout
2912 \begin_inset Flex TextField
2915 \begin_layout Plain Layout
2916 \begin_inset Argument 1
2919 \begin_layout Plain Layout
2920 name=from,width=10em
2937 <cell alignment="center" valignment="top" usebox="none">
2940 \begin_layout Plain Layout
2946 <cell alignment="center" valignment="top" usebox="none">
2949 \begin_layout Plain Layout
2950 \begin_inset VSpace -1.5mm
2960 <cell alignment="left" valignment="top" usebox="none">
2963 \begin_layout Plain Layout
2969 <cell alignment="center" valignment="top" usebox="none">
2972 \begin_layout Plain Layout
2973 \begin_inset Flex TextField
2976 \begin_layout Plain Layout
2977 \begin_inset Argument 1
2980 \begin_layout Plain Layout
3004 \begin_layout Standard
3005 \begin_inset VSpace bigskip
3011 \begin_layout Standard
3012 To check and assure that the user only enters a number to a text field you
3013 can for example use this JavaScript code:
3016 \begin_layout Standard
3017 \begin_inset listings
3018 lstparams "language=TeX"
3022 \begin_layout Plain Layout
3024 function checkNumber() {
3027 \begin_layout Plain Layout
3032 \begin_layout Plain Layout
3034 if (!Number(event.value)) {
3037 \begin_layout Plain Layout
3039 app.alert("Value must be a number!");
3042 \begin_layout Plain Layout
3047 \begin_layout Plain Layout
3052 \begin_layout Plain Layout
3054 event.target.textColor = color.green;
3057 \begin_layout Plain Layout
3067 \begin_layout Standard
3068 An example text field:
3069 \begin_inset Flex TextField
3072 \begin_layout Plain Layout
3073 \begin_inset Argument 1
3076 \begin_layout Plain Layout
3077 name=onlyNumbers, align=1, validate={checkNumber();}
3090 \begin_layout Standard
3094 \begin_layout Plain Layout
3104 \begin_inset Note Note
3107 \begin_layout Plain Layout
3108 The following will be displayed when the \SpecialChar LaTeX
3121 \begin_layout Standard
3122 You need to install the package
3126 to see the content of this section in the output.
3129 \begin_layout Standard
3133 \begin_layout Plain Layout
3145 \begin_layout End PDF Form
3146 \begin_inset Note Note
3149 \begin_layout Plain Layout
3158 \begin_layout Section
3159 General notes and hints
3162 \begin_layout Itemize
3163 Submitting and applying data requires that all form fields have a name.
3166 \begin_layout Itemize
3167 All braces, brackets, backslashes and quote characters in form parameters
3168 must be inserted as \SpecialChar TeX
3172 \begin_layout Itemize
3173 Creating a PDF form requires pdflatex or lualatex.
3174 Use either the \SpecialChar LyX
3181 PDF (Lua\SpecialChar TeX
3187 \begin_layout Itemize
3196 custom background colors you must disable in these programs to highlight
3197 the available form fields in the PDF.
3200 \begin_layout Bibliography
3201 \begin_inset CommandInset bibitem
3202 LatexCommand bibitem
3208 \begin_inset CommandInset href
3210 name "JavaScript reference"
3211 target "https://developer.mozilla.org/en/docs/Web/JavaScript/Reference"
3218 \begin_layout Bibliography
3219 \begin_inset CommandInset bibitem
3220 LatexCommand bibitem
3226 \begin_inset CommandInset href
3228 name "Documentation"
3229 target "http://mirrors.ctan.org/macros/latex/contrib/hyperref/doc/manual.pdf"
3233 of the \SpecialChar LaTeX
3239 \begin_layout Bibliography
3240 \begin_inset CommandInset bibitem
3241 LatexCommand bibitem
3247 \begin_inset CommandInset href
3249 name "Documentation"
3250 target "http://mirrors.ctan.org/macros/latex/required/psnfss/psnfss2e.pdf"
3254 of the \SpecialChar LaTeX