]> git.lyx.org Git - lyx.git/blob - lib/examples/PDF-form.lyx
3ade400592a3fb4e84840e6267c5681ffea72752
[lyx.git] / lib / examples / PDF-form.lyx
1 #LyX 2.1 created this file. For more info see http://www.lyx.org/
2 \lyxformat 474
3 \begin_document
4 \begin_header
5 \textclass scrartcl
6 \begin_preamble
7 % to be able to use custom colors
8 \usepackage[svgnames,rgb]{xcolor}
9
10 % ------------------------------------
11 % used to check for needed LaTeX packages
12 \usepackage{ifthen}
13
14 % check for package insdljs
15 % used for JavScript code
16 \newboolean{insdljs}
17 \IfFileExists{insdljs.sty}
18  {\usepackage{insdljs}
19   \setboolean{insdljs}{true}}
20  {\setboolean{insdljs}{false}}
21
22 \pdfcatalog{/AA \the\pdflastobj\space 0 R}
23 \begin{insDLJS}[exaaae]{exaaae}{JavaScript}
24   function validateTime(){
25    this.delay = true;
26    if((event.value == "u") || (event.value == "unlimited")) {
27    this.getField("from").display = display.hidden;
28    this.getField("to").display = display.hidden;
29   } else {
30    this.getField("from").display = display.visible;
31    this.getField("to").display = display.visible;
32    this.getField("from").setFocus();
33   }
34   this.delay = false;
35   }
36 \end{insDLJS}
37
38 % if pdflatex is used
39 \usepackage{ifpdf}
40 \ifpdf
41
42 % set fonts for nicer pdf view
43 \IfFileExists{lmodern.sty}
44  {\usepackage{lmodern}}{}
45
46 \fi % end if pdflatex is used
47 \end_preamble
48 \options BCOR8mm,pagesize
49 \use_default_options false
50 \begin_modules
51 pdfform
52 \end_modules
53 \maintain_unincluded_children false
54 \language english
55 \language_package default
56 \inputencoding auto
57 \fontencoding global
58 \font_roman default
59 \font_sans default
60 \font_typewriter default
61 \font_math auto
62 \font_default_family default
63 \use_non_tex_fonts false
64 \font_sc false
65 \font_osf false
66 \font_sf_scale 100
67 \font_tt_scale 100
68 \graphics default
69 \default_output_format default
70 \output_sync 0
71 \bibtex_command bibtex
72 \index_command default
73 \paperfontsize 12
74 \spacing single
75 \use_hyperref true
76 \pdf_title "Description of the module pdfcomment"
77 \pdf_author "Uwe Stöhr"
78 \pdf_subject "PDF form"
79 \pdf_keywords "LyX, PDF forms, hyperref"
80 \pdf_bookmarks true
81 \pdf_bookmarksnumbered true
82 \pdf_bookmarksopen true
83 \pdf_bookmarksopenlevel 2
84 \pdf_breaklinks false
85 \pdf_pdfborder false
86 \pdf_colorlinks false
87 \pdf_backref false
88 \pdf_pdfusetitle false
89 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue, pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false, urlbordercolor={1 0 0}"
90 \papersize a4paper
91 \use_geometry false
92 \use_package amsmath 1
93 \use_package amssymb 1
94 \use_package cancel 0
95 \use_package esint 1
96 \use_package mathdots 1
97 \use_package mathtools 1
98 \use_package mhchem 1
99 \use_package stackrel 0
100 \use_package stmaryrd 0
101 \use_package undertilde 0
102 \cite_engine basic
103 \cite_engine_type default
104 \biblio_style plain
105 \use_bibtopic false
106 \use_indices false
107 \paperorientation portrait
108 \suppress_date true
109 \justification true
110 \use_refstyle 0
111 \notefontcolor #0000ff
112 \index Index
113 \shortcut idx
114 \color #008000
115 \end_index
116 \secnumdepth 3
117 \tocdepth 2
118 \paragraph_separation skip
119 \defskip medskip
120 \quotes_language english
121 \papercolumns 1
122 \papersides 1
123 \paperpagestyle default
124 \tracking_changes false
125 \output_changes false
126 \html_math_output 0
127 \html_css_as_file 0
128 \html_be_strict false
129 \end_header
130
131 \begin_body
132
133 \begin_layout Begin PDF Form
134 \begin_inset Argument 1
135 status open
136
137 \begin_layout Plain Layout
138 action=mailto:forms@lyx.test?subject={The submitted PDF form},method=post
139 \end_layout
140
141 \end_inset
142
143
144 \end_layout
145
146 \begin_layout Title
147 Description of the module PDF Form
148 \end_layout
149
150 \begin_layout Author
151 Uwe Stöhr
152 \end_layout
153
154 \begin_layout Standard
155 \begin_inset Note Note
156 status open
157
158 \begin_layout Plain Layout
159 To export all parts of this document to PDF the LaTeX-package 
160 \series bold
161 insdljs
162 \series default
163  must be installed.
164  If it is not installed you can export the document anyway but the example
165  in the section about dynamic form fields won't appear in the output.
166 \end_layout
167
168 \end_inset
169
170
171 \end_layout
172
173 \begin_layout Standard
174 By loading the module PDF
175 \begin_inset space ~
176 \end_inset
177
178 Form the whole document or a part of it can be made a PDF form.
179  You can add all possible form elements like text fields buttons etc.
180  This document describes how this is done.
181 \end_layout
182
183 \begin_layout Section
184 Preparation
185 \begin_inset CommandInset label
186 LatexCommand label
187 name "sec:Preparation"
188
189 \end_inset
190
191
192 \end_layout
193
194 \begin_layout Standard
195 At first load the module PDF
196 \begin_inset space ~
197 \end_inset
198
199 Form in the document settings of your file.
200  To make the whole document a form, insert the environment
201 \family sans
202  Begin
203 \begin_inset space ~
204 \end_inset
205
206 PDF
207 \begin_inset space ~
208 \end_inset
209
210 Form
211 \family default
212  from LyX's dropdown menu at the beginning of the document.
213  If only a part of the document should be a form, add 
214 \family sans
215 Begin
216 \begin_inset space ~
217 \end_inset
218
219 PDF
220 \begin_inset space ~
221 \end_inset
222
223 Form
224 \family default
225  at the position where the form should start.
226 \end_layout
227
228 \begin_layout Standard
229 \begin_inset Note Greyedout
230 status open
231
232 \begin_layout Plain Layout
233
234 \series bold
235 Note:
236 \series default
237  It is only possible to have one form in a PDF file!
238 \end_layout
239
240 \end_inset
241
242
243 \end_layout
244
245 \begin_layout Standard
246 If the form data should be submitted to a server or the like, then you must
247  specify the URL to where it should be submitted as parameter of the 
248 \family sans
249 Begin
250 \begin_inset space ~
251 \end_inset
252
253 PDF
254 \begin_inset space ~
255 \end_inset
256
257 Form
258 \family default
259  environment.
260  This is done by using the menu 
261 \family sans
262 Insert\SpecialChar \menuseparator
263 PDF
264 \begin_inset space ~
265 \end_inset
266
267 form
268 \begin_inset space ~
269 \end_inset
270
271 parameters
272 \family default
273 .
274  For example in this document the following was inserted to the parameter
275  inset:
276 \end_layout
277
278 \begin_layout Standard
279
280 \series bold
281 action=mailto:forms@lyx.test?subject={The submitted PDF form},
282 \begin_inset Newline newline
283 \end_inset
284
285 method=post
286 \end_layout
287
288 \begin_layout Standard
289 This sends the form data as email to 
290 \emph on
291 forms@lyx.test
292 \emph default
293 .
294  The email subject is 
295 \begin_inset Quotes eld
296 \end_inset
297
298 The submitted PDF form
299 \begin_inset Quotes erd
300 \end_inset
301
302  and the HTML method is 
303 \series bold
304 post
305 \series default
306 .
307  (The other possible method would be 
308 \series bold
309 get
310 \series default
311 .)
312 \end_layout
313
314 \begin_layout Standard
315 \begin_inset Newpage newpage
316 \end_inset
317
318
319 \end_layout
320
321 \begin_layout Section
322 Form fields
323 \end_layout
324
325 \begin_layout Standard
326 There are 6
327 \begin_inset space ~
328 \end_inset
329
330 possible types of fields in a PDF form:
331 \end_layout
332
333 \begin_layout Subsection
334 Text field
335 \end_layout
336
337 \begin_layout Standard
338 A text field is added by inserting the custom inset 
339 \family sans
340 TextField
341 \family default
342  using the menu 
343 \family sans
344 Insert\SpecialChar \menuseparator
345 Custom
346 \begin_inset space ~
347 \end_inset
348
349 Insets
350 \family default
351 .
352  Write inside the inset the label for the text field that will be printed
353  in the PDF output before the field.
354  Here is an example:
355 \begin_inset Newline newline
356 \end_inset
357
358
359 \begin_inset Flex TextField
360 status open
361
362 \begin_layout Plain Layout
363
364 \begin_inset Argument 1
365 status open
366
367 \begin_layout Plain Layout
368 name=customer
369 \end_layout
370
371 \end_inset
372
373 Enter your name here:
374 \end_layout
375
376 \end_inset
377
378
379 \end_layout
380
381 \begin_layout Standard
382 You must also specify a field name for text fields: Set the cursor into
383  the inset and use the menu 
384 \family sans
385 Insert\SpecialChar \menuseparator
386 PDF
387 \begin_inset space ~
388 \end_inset
389
390 form
391 \begin_inset space ~
392 \end_inset
393
394 parameters
395 \family default
396 .
397  There insert for example the parameter 
398 \series bold
399 name=customer
400 \series default
401  (where 
402 \series bold
403 customer
404 \series default
405  is the field name).
406  Only if your text field has a label and no parameters the specification
407  of the name can be omitted.
408 \end_layout
409
410 \begin_layout Standard
411 All form fields can be customized by adding a parameter inset to them.
412  To do this, set the cursor into the field inset and use the menu 
413 \family sans
414 Insert\SpecialChar \menuseparator
415 PDF
416 \begin_inset space ~
417 \end_inset
418
419 form
420 \begin_inset space ~
421 \end_inset
422
423 parameters
424 \family default
425 .
426 \end_layout
427
428 \begin_layout Standard
429 \begin_inset Note Greyedout
430 status open
431
432 \begin_layout Plain Layout
433
434 \series bold
435 Note:
436 \series default
437  All braces and brackets in form parameters must be inserted as TeX code!
438 \end_layout
439
440 \end_inset
441
442
443 \end_layout
444
445 \begin_layout Standard
446 Here is a customized multiline text field with a width of 5
447 \begin_inset space \thinspace{}
448 \end_inset
449
450 cm and a proposed content:
451 \begin_inset VSpace defskip
452 \end_inset
453
454
455 \begin_inset Newline newline
456 \end_inset
457
458
459 \begin_inset Flex TextField
460 status open
461
462 \begin_layout Plain Layout
463
464 \begin_inset Argument 1
465 status open
466
467 \begin_layout Plain Layout
468 name=customer2, width=5cm, multiline, width=0.6
469 \backslash
470 textwidth, height=3cm, value={Testman}
471 \end_layout
472
473 \end_inset
474
475 Enter your name here:
476 \end_layout
477
478 \end_inset
479
480
481 \end_layout
482
483 \begin_layout Standard
484 \begin_inset Note Greyedout
485 status open
486
487 \begin_layout Plain Layout
488
489 \series bold
490 Note:
491 \series default
492  It is highly recommended to use a uniform layout of all fields in your
493  form.
494  See sec.
495 \begin_inset space \thinspace{}
496 \end_inset
497
498
499 \begin_inset CommandInset ref
500 LatexCommand ref
501 reference "sec:Form-field-and"
502
503 \end_inset
504
505  for how this is done.
506 \end_layout
507
508 \end_inset
509
510
511 \end_layout
512
513 \begin_layout Subsection
514 Check box
515 \end_layout
516
517 \begin_layout Standard
518 A check box is added by inserting the custom inset 
519 \family sans
520 CheckBox
521 \family default
522 .
523  Write inside the inset the label for the box.
524  Here is an example:
525 \begin_inset Newline newline
526 \end_inset
527
528
529 \begin_inset Flex CheckBox
530 status open
531
532 \begin_layout Plain Layout
533
534 \begin_inset Argument 1
535 status open
536
537 \begin_layout Plain Layout
538 name=age
539 \end_layout
540
541 \end_inset
542
543 Are you older than 18 years?
544 \end_layout
545
546 \end_inset
547
548
549 \end_layout
550
551 \begin_layout Standard
552 You must also specify a field name for check boxes: Set the cursor into
553  the inset and use the menu 
554 \family sans
555 Insert\SpecialChar \menuseparator
556 PDF
557 \begin_inset space ~
558 \end_inset
559
560 form
561 \begin_inset space ~
562 \end_inset
563
564 parameters
565 \family default
566 .
567  There insert for example the parameter 
568 \series bold
569 name=age
570 \series default
571  (where 
572 \series bold
573 age
574 \series default
575  is the field name).
576  Only if your check box has a label and no parameters the specification
577  of the name can be omitted.
578 \end_layout
579
580 \begin_layout Subsection
581 Choice menu
582 \end_layout
583
584 \begin_layout Standard
585 A choice menu is added by inserting the custom inset 
586 \family sans
587 ChoiceMenu
588 \family default
589 .
590  The label is inserted into the 
591 \family sans
592 Label
593 \family default
594  inset.
595  The choices are inserted to the inset as comma-separated list.
596  There are 3
597 \begin_inset space ~
598 \end_inset
599
600 choice menu types:
601 \end_layout
602
603 \begin_layout Description
604 Radio Only one choice can be selected
605 \end_layout
606
607 \begin_layout Description
608 Combo The choices are listed in a combo box (dropdown list) but the user
609  is allowed to choose something that is not in the predefined list.
610 \end_layout
611
612 \begin_layout Description
613 Popdown All choices are listed below each other.
614  It the filed is not high enough a scroll bar is automatically added to
615  the field.
616 \end_layout
617
618 \begin_layout Standard
619 To determine the choice menu type, set the cursor into the inset and use
620  the menu 
621 \family sans
622 Insert\SpecialChar \menuseparator
623 PDF
624 \begin_inset space ~
625 \end_inset
626
627 form
628 \begin_inset space ~
629 \end_inset
630
631 parameters
632 \family default
633 .
634  There insert the parameter 
635 \series bold
636 radio
637 \series default
638
639 \series bold
640 combo
641 \series default
642  or 
643 \series bold
644 popdown
645 \series default
646 .
647 \end_layout
648
649 \begin_layout Standard
650 Here is an example for the radio type:
651 \begin_inset Newline newline
652 \end_inset
653
654
655 \begin_inset Flex ChoiceMenu
656 status open
657
658 \begin_layout Plain Layout
659
660 \begin_inset Argument 1
661 status open
662
663 \begin_layout Plain Layout
664 radio
665 \end_layout
666
667 \end_inset
668
669 male=m, female=f
670 \begin_inset Argument 2
671 status open
672
673 \begin_layout Plain Layout
674 Sex:
675 \end_layout
676
677 \end_inset
678
679
680 \end_layout
681
682 \end_inset
683
684
685 \end_layout
686
687 \begin_layout Standard
688 Here is an example for the combo type:
689 \begin_inset Newline newline
690 \end_inset
691
692
693 \begin_inset Flex ChoiceMenu
694 status open
695
696 \begin_layout Plain Layout
697
698 \begin_inset Argument 1
699 status open
700
701 \begin_layout Plain Layout
702 combo
703 \end_layout
704
705 \end_inset
706
707 Albania=Al, Armenia=Ar, Azerbaidschan=Az
708 \begin_inset Argument 2
709 status open
710
711 \begin_layout Plain Layout
712 Country:
713 \end_layout
714
715 \end_inset
716
717
718 \end_layout
719
720 \end_inset
721
722
723 \end_layout
724
725 \begin_layout Standard
726 Here is an example for the popdown type:
727 \begin_inset Newline newline
728 \end_inset
729
730
731 \begin_inset Flex ChoiceMenu
732 status open
733
734 \begin_layout Plain Layout
735
736 \begin_inset Argument 1
737 status open
738
739 \begin_layout Plain Layout
740 popdown, name=country
741 \end_layout
742
743 \end_inset
744
745 Albania=Al, Armenia=Ar, Azerbaidschan=Az
746 \begin_inset Argument 2
747 status open
748
749 \begin_layout Plain Layout
750 Country:
751 \end_layout
752
753 \end_inset
754
755
756 \end_layout
757
758 \end_inset
759
760
761 \end_layout
762
763 \begin_layout Standard
764 \begin_inset Note Greyedout
765 status open
766
767 \begin_layout Plain Layout
768
769 \series bold
770 Note:
771 \series default
772  For the popdown type you must always specify a field name: Add to the 
773 \family sans
774 PDF
775 \begin_inset space ~
776 \end_inset
777
778 form
779 \begin_inset space ~
780 \end_inset
781
782 parameters
783 \family default
784  for example the parameter 
785 \series bold
786 name=country
787 \series default
788  (where 
789 \series bold
790 country
791 \series default
792  is the field name).
793 \end_layout
794
795 \end_inset
796
797
798 \end_layout
799
800 \begin_layout Standard
801 It is recommended to add a short name for every choice to be able to access
802  them and to know which one was chosen by the user- This is done by adding
803  
804 \series bold
805 =name
806 \series default
807  behind each choice (where 
808 \series bold
809 name
810 \series default
811  is the choice name).
812  For example the radio type example contains this choice list:
813 \series bold
814  male=m, female=f
815 \series default
816 .
817  If the user chose 
818 \begin_inset Quotes eld
819 \end_inset
820
821 male
822 \begin_inset Quotes erd
823 \end_inset
824
825  you know that he chose the choice 
826 \begin_inset Quotes eld
827 \end_inset
828
829 m
830 \begin_inset Quotes erd
831 \end_inset
832
833 .
834  By specifying names you can also preset/propose e.g.
835 \begin_inset space \space{}
836 \end_inset
837
838 the choice 
839 \begin_inset Quotes eld
840 \end_inset
841
842 male
843 \begin_inset Quotes erd
844 \end_inset
845
846  by adding the parameter 
847 \series bold
848 default=m
849 \series default
850 .
851  Here is an example:
852 \end_layout
853
854 \begin_layout Standard
855 \begin_inset Flex ChoiceMenu
856 status open
857
858 \begin_layout Plain Layout
859
860 \begin_inset Argument 1
861 status open
862
863 \begin_layout Plain Layout
864 radio, name=sex, default=m
865 \end_layout
866
867 \end_inset
868
869 male=m, female=f
870 \begin_inset Argument 2
871 status open
872
873 \begin_layout Plain Layout
874 Sex:
875 \end_layout
876
877 \end_inset
878
879
880 \end_layout
881
882 \end_inset
883
884
885 \end_layout
886
887 \begin_layout Standard
888 \begin_inset Note Greyedout
889 status open
890
891 \begin_layout Plain Layout
892
893 \series bold
894 Note:
895 \series default
896  Due to a bug in the LaTeX package 
897 \series bold
898 hyperref
899 \series default
900  it is currently only possible the set the first choice as default.
901 \end_layout
902
903 \end_inset
904
905
906 \end_layout
907
908 \begin_layout Subsection
909 Push button
910 \end_layout
911
912 \begin_layout Standard
913 A push button is added by inserting the custom inset 
914 \family sans
915 PushButton
916 \family default
917 .
918  Write inside the inset the label for the button.
919  Here is an example:
920 \begin_inset Newline newline
921 \end_inset
922
923
924 \begin_inset Flex PushButton
925 status open
926
927 \begin_layout Plain Layout
928
929 Don't click on this button or your fridge will be destroyed!!!
930 \end_layout
931
932 \end_inset
933
934
935 \end_layout
936
937 \begin_layout Standard
938 The action that is triggered by pressing the button is specified by JavaScript
939  code.
940  To specify it, set the cursor into the inset and use the menu 
941 \family sans
942 Insert\SpecialChar \menuseparator
943 PDF
944 \begin_inset space ~
945 \end_inset
946
947 form
948 \begin_inset space ~
949 \end_inset
950
951 parameters
952 \family default
953 .
954  There insert the parameter 
955 \series bold
956 onclick={}
957 \series default
958  and write the JavaScript code between the braces.
959 \end_layout
960
961 \begin_layout Standard
962 \begin_inset Flex PushButton
963 status open
964
965 \begin_layout Plain Layout
966
967 \begin_inset Argument 1
968 status open
969
970 \begin_layout Plain Layout
971 onclick={app.alert("What the hell? Now you destroyed your fridge.
972  Congratulations.")}
973 \end_layout
974
975 \end_inset
976
977 Don't click on this button or your fridge will be destroyed!!!
978 \end_layout
979
980 \end_inset
981
982
983 \end_layout
984
985 \begin_layout Standard
986 For info about JavaScript, see its documentation, 
987 \begin_inset CommandInset citation
988 LatexCommand cite
989 key "JavaScript"
990
991 \end_inset
992
993 .
994 \end_layout
995
996 \begin_layout Standard
997 A common usage for pus buttons is to open a weblink.
998  Such a button is created by inserting the command 
999 \series bold
1000
1001 \backslash
1002 href
1003 \series default
1004  into the button inset.
1005  
1006 \series bold
1007
1008 \backslash
1009 href
1010 \series default
1011  is used in the scheme
1012 \begin_inset Newline newline
1013 \end_inset
1014
1015
1016 \series bold
1017
1018 \backslash
1019 href{link target}{text}
1020 \end_layout
1021
1022 \begin_layout Standard
1023 In the following button this code was used:
1024 \begin_inset Newline newline
1025 \end_inset
1026
1027
1028 \series bold
1029
1030 \backslash
1031 href{http://wiki.lyx.org}{Information how to fill out this form}
1032 \end_layout
1033
1034 \begin_layout Standard
1035 \begin_inset Flex PushButton
1036 status open
1037
1038 \begin_layout Plain Layout
1039
1040
1041 \backslash
1042 href{http://wiki.lyx.org}{Information how to fill out this form}
1043 \end_layout
1044
1045 \end_inset
1046
1047
1048 \end_layout
1049
1050 \begin_layout Standard
1051 To get rid of the frame for weblinks add this to the additional options
1052  in the document settings under 
1053 \family sans
1054 PDF
1055 \begin_inset space ~
1056 \end_inset
1057
1058 properties
1059 \family default
1060 :
1061 \end_layout
1062
1063 \begin_layout Standard
1064
1065 \series bold
1066 urlbordercolor={1 0 0}
1067 \end_layout
1068
1069 \begin_layout Standard
1070 if your push button border color is red (the default), otherwise use the
1071  same color definition as for your push button border color.
1072 \end_layout
1073
1074 \begin_layout Subsection
1075 Submit button
1076 \end_layout
1077
1078 \begin_layout Standard
1079 A submit button is used to submit the form data to a server.
1080  It is added by inserting the custom inset 
1081 \family sans
1082 SubmitButton
1083 \family default
1084 .
1085  Write inside the inset the label for the button.
1086  Here is an example:
1087 \begin_inset Newline newline
1088 \end_inset
1089
1090
1091 \begin_inset Flex SubmitButton
1092 status open
1093
1094 \begin_layout Plain Layout
1095
1096 \begin_inset Argument 1
1097 status open
1098
1099 \begin_layout Plain Layout
1100 name=submit1
1101 \end_layout
1102
1103 \end_inset
1104
1105 Send your data via email
1106 \end_layout
1107
1108 \end_inset
1109
1110
1111 \end_layout
1112
1113 \begin_layout Standard
1114 \begin_inset Note Greyedout
1115 status open
1116
1117 \begin_layout Plain Layout
1118
1119 \series bold
1120 Note:
1121 \series default
1122  You can only use a submit button if you specified the submit method and
1123  target in the PDF form environment options! See sec.
1124 \begin_inset space \thinspace{}
1125 \end_inset
1126
1127
1128 \begin_inset CommandInset ref
1129 LatexCommand ref
1130 reference "sec:Preparation"
1131
1132 \end_inset
1133
1134  for the description.
1135  If there are no specifications you will get LaTeX errors!
1136 \end_layout
1137
1138 \end_inset
1139
1140
1141 \end_layout
1142
1143 \begin_layout Standard
1144 \begin_inset Note Greyedout
1145 status open
1146
1147 \begin_layout Plain Layout
1148
1149 \series bold
1150 Note:
1151 \series default
1152  If you have more than one submit button in your document you must specify
1153  a name for each of them to avoid LaTeX errors! For example write 
1154 \series bold
1155 name=submit1
1156 \series default
1157  (where 
1158 \series bold
1159 submit1
1160 \series default
1161  is the button name).
1162 \end_layout
1163
1164 \end_inset
1165
1166
1167 \end_layout
1168
1169 \begin_layout Subsection
1170 Reset button
1171 \end_layout
1172
1173 \begin_layout Standard
1174 A reset button is used to reset all form fields to the initial state.
1175  It is added by inserting the custom inset 
1176 \family sans
1177 ResetButton
1178 \family default
1179 .
1180  Write inside the inset the label for the button.
1181  Here is an example:
1182 \begin_inset Newline newline
1183 \end_inset
1184
1185
1186 \begin_inset Flex ResetButton
1187 status open
1188
1189 \begin_layout Plain Layout
1190
1191 \begin_inset Argument 1
1192 status open
1193
1194 \begin_layout Plain Layout
1195 name=reset1
1196 \end_layout
1197
1198 \end_inset
1199
1200 Reset the form
1201 \end_layout
1202
1203 \end_inset
1204
1205
1206 \end_layout
1207
1208 \begin_layout Standard
1209 \begin_inset Note Greyedout
1210 status open
1211
1212 \begin_layout Plain Layout
1213
1214 \series bold
1215 Note:
1216 \series default
1217  If you have more than one reset button in your document you must specify
1218  a name for each of them to avoid LaTeX errors! For example write 
1219 \series bold
1220 name=submit1
1221 \series default
1222  (where 
1223 \series bold
1224 submit1
1225 \series default
1226  is the button name).
1227 \end_layout
1228
1229 \end_inset
1230
1231
1232 \end_layout
1233
1234 \begin_layout Section
1235 PDF viewer action buttons
1236 \end_layout
1237
1238 \begin_layout Standard
1239 One often needs basic actions to be done by the PDF viewer program.
1240  For example to print the form.
1241  Such PDF program-specific actions can be triggered by adding inserting
1242  the custom inset 
1243 \family sans
1244 PDFAction
1245 \family default
1246 .
1247  The PDF viewer programs 
1248 \emph on
1249 Acrobat
1250 \emph default
1251  and 
1252 \emph on
1253 Adobe Reader
1254 \emph default
1255  can handle all possible actions while other PDF viewers might only support
1256  some of them.
1257  However, all PDF viewer programs support the basic things like printing,
1258  save
1259 \begin_inset space ~
1260 \end_inset
1261
1262 as, view in fullscreen etc..
1263 \end_layout
1264
1265 \begin_layout Standard
1266 To specify the action insert its name to the 
1267 \family sans
1268 Action
1269 \family default
1270  inset.
1271  A list with possible actions can be found in sec.
1272 \begin_inset space \thinspace{}
1273 \end_inset
1274
1275
1276 \begin_inset Quotes eld
1277 \end_inset
1278
1279 Acrobat-specific behavior
1280 \begin_inset Quotes erd
1281 \end_inset
1282
1283  of the documentation of the LaTeX package 
1284 \series bold
1285 hyperref
1286 \series default
1287
1288 \begin_inset CommandInset citation
1289 LatexCommand cite
1290 key "hyperref"
1291
1292 \end_inset
1293
1294 .
1295 \end_layout
1296
1297 \begin_layout Standard
1298 Here are some examples:
1299 \end_layout
1300
1301 \begin_layout Description
1302 Printing: 
1303 \begin_inset Flex PDFAction
1304 status open
1305
1306 \begin_layout Plain Layout
1307
1308 \begin_inset Argument 1
1309 status open
1310
1311 \begin_layout Plain Layout
1312 Print
1313 \end_layout
1314
1315 \end_inset
1316
1317 Print the document
1318 \end_layout
1319
1320 \end_inset
1321
1322
1323 \end_layout
1324
1325 \begin_layout Description
1326 Save
1327 \begin_inset space ~
1328 \end_inset
1329
1330 as: 
1331 \begin_inset Flex PDFAction
1332 status open
1333
1334 \begin_layout Plain Layout
1335
1336 \begin_inset Argument 1
1337 status open
1338
1339 \begin_layout Plain Layout
1340 SaveAs
1341 \end_layout
1342
1343 \end_inset
1344
1345 Save document as
1346 \end_layout
1347
1348 \end_inset
1349
1350
1351 \end_layout
1352
1353 \begin_layout Description
1354 View
1355 \begin_inset space ~
1356 \end_inset
1357
1358 in
1359 \begin_inset space ~
1360 \end_inset
1361
1362 fullscreen: 
1363 \begin_inset Flex PDFAction
1364 status open
1365
1366 \begin_layout Plain Layout
1367
1368 \begin_inset Argument 1
1369 status open
1370
1371 \begin_layout Plain Layout
1372 FullScreen
1373 \end_layout
1374
1375 \end_inset
1376
1377 View the form in fullscreen
1378 \end_layout
1379
1380 \end_inset
1381
1382
1383 \end_layout
1384
1385 \begin_layout Section
1386 Form field and button customization
1387 \begin_inset CommandInset label
1388 LatexCommand label
1389 name "sec:Form-field-and"
1390
1391 \end_inset
1392
1393
1394 \end_layout
1395
1396 \begin_layout Standard
1397 Since all form elements should look uniform, one can determine their layout
1398  using the following styles:
1399 \end_layout
1400
1401 \begin_layout Description
1402 Text
1403 \begin_inset space ~
1404 \end_inset
1405
1406 Field
1407 \begin_inset space ~
1408 \end_inset
1409
1410 Style
1411 \end_layout
1412
1413 \begin_layout Description
1414 Check
1415 \begin_inset space ~
1416 \end_inset
1417
1418 Box
1419 \begin_inset space ~
1420 \end_inset
1421
1422 Style 
1423 \end_layout
1424
1425 \begin_layout Description
1426 List
1427 \begin_inset space ~
1428 \end_inset
1429
1430 Box
1431 \begin_inset space ~
1432 \end_inset
1433
1434 Style affects all choice menu types
1435 \end_layout
1436
1437 \begin_layout Description
1438 Combo
1439 \begin_inset space ~
1440 \end_inset
1441
1442 Box
1443 \begin_inset space ~
1444 \end_inset
1445
1446 Style affects only the combo box style
1447 \end_layout
1448
1449 \begin_layout Description
1450 Popdown
1451 \begin_inset space ~
1452 \end_inset
1453
1454 Box
1455 \begin_inset space ~
1456 \end_inset
1457
1458 Style affects only the popdown box style
1459 \end_layout
1460
1461 \begin_layout Description
1462 Radio
1463 \begin_inset space ~
1464 \end_inset
1465
1466 Box
1467 \begin_inset space ~
1468 \end_inset
1469
1470 Style affects only the radio box style
1471 \end_layout
1472
1473 \begin_layout Description
1474 Push
1475 \begin_inset space ~
1476 \end_inset
1477
1478 Button
1479 \begin_inset space ~
1480 \end_inset
1481
1482 Style
1483 \end_layout
1484
1485 \begin_layout Description
1486 Submit
1487 \begin_inset space ~
1488 \end_inset
1489
1490 Button
1491 \begin_inset space ~
1492 \end_inset
1493
1494 Style
1495 \end_layout
1496
1497 \begin_layout Description
1498 Reset
1499 \begin_inset space ~
1500 \end_inset
1501
1502 Button
1503 \begin_inset space ~
1504 \end_inset
1505
1506 Style
1507 \end_layout
1508
1509 \begin_layout Text Field Style
1510
1511 \end_layout
1512
1513 \begin_layout Standard
1514 The content of the styles is a comma-separated list of parameters.
1515  The possible parameters are listed in sec.
1516 \begin_inset space \thinspace{}
1517 \end_inset
1518
1519 6.2 
1520 \begin_inset Quotes eld
1521 \end_inset
1522
1523 Forms optional parameters
1524 \begin_inset Quotes erd
1525 \end_inset
1526
1527  of the documentation of the LaTeX package 
1528 \series bold
1529 hyperref
1530 \series default
1531
1532 \begin_inset CommandInset citation
1533 LatexCommand cite
1534 key "hyperref"
1535
1536 \end_inset
1537
1538 .
1539  It is important that the parameter print is always part of the definition,
1540  otherwise the fields won't appear in the PDF output.
1541  The defined style is applied to all fields following the definition.
1542 \end_layout
1543
1544 \begin_layout Subsubsection*
1545 Here are some examples:
1546 \end_layout
1547
1548 \begin_layout Text Field Style
1549 print, bordercolor=red,borderstyle=U, backgroundcolor=lightgray, color=lime,
1550  maxlen=10, align=2, charsize=16pt
1551 \end_layout
1552
1553 \begin_layout Check Box Style
1554 print, borderstyle=S, checkboxsymbol=
1555 \backslash
1556 ding{55}
1557 \end_layout
1558
1559 \begin_layout Combo Box Style
1560 print, bordercolor={0.33 0.66 0.33}, borderstyle=D
1561 \end_layout
1562
1563 \begin_layout Popdown Box Style
1564 print, menulength=2
1565 \end_layout
1566
1567 \begin_layout Radio Box Style
1568 print, borderstyle=I, radiosymbol=6
1569 \end_layout
1570
1571 \begin_layout Push Button Style
1572 print, borderstyle=B, bordercolor=lime
1573 \end_layout
1574
1575 \begin_layout Submit Button Style
1576 print, borderwidth=0, bordercolor=white
1577 \end_layout
1578
1579 \begin_layout Reset Button Style
1580 print, bordercolor=lime
1581 \end_layout
1582
1583 \begin_layout Itemize
1584 Text field with gray background, lime text color, a red border only below
1585  the field, right alignment, 16
1586 \begin_inset space \thinspace{}
1587 \end_inset
1588
1589 pt font size and a limitation for maximal 10
1590 \begin_inset space ~
1591 \end_inset
1592
1593 characters to insert:
1594 \begin_inset VSpace defskip
1595 \end_inset
1596
1597
1598 \begin_inset Newline newline
1599 \end_inset
1600
1601
1602 \begin_inset Flex TextField
1603 status open
1604
1605 \begin_layout Plain Layout
1606
1607 Enter your name here:
1608 \end_layout
1609
1610 \end_inset
1611
1612
1613 \end_layout
1614
1615 \begin_layout Standard
1616 The 
1617 \series bold
1618 borderstyle
1619 \series default
1620  can be 
1621 \series bold
1622 U
1623 \series default
1624  (underlined), 
1625 \series bold
1626 S
1627 \series default
1628  (solid), 
1629 \series bold
1630 D
1631 \series default
1632  (dashed), 
1633 \series bold
1634 B
1635 \series default
1636  (bevel), or 
1637 \series bold
1638 I
1639 \series default
1640  (inverted bevel).
1641 \end_layout
1642
1643 \begin_layout Standard
1644 \begin_inset Note Greyedout
1645 status open
1646
1647 \begin_layout Plain Layout
1648
1649 \series bold
1650 Note
1651 \series default
1652  that the 
1653 \series bold
1654 value
1655 \series default
1656  has only an effect for text fields if a 
1657 \series bold
1658 name
1659 \series default
1660  was specified.
1661 \end_layout
1662
1663 \end_inset
1664
1665
1666 \end_layout
1667
1668 \begin_layout Itemize
1669 Check box with normal border and symbol 
1670 \backslash
1671 ding{55}:
1672 \begin_inset VSpace defskip
1673 \end_inset
1674
1675
1676 \begin_inset Newline newline
1677 \end_inset
1678
1679
1680 \begin_inset Flex CheckBox
1681 status open
1682
1683 \begin_layout Plain Layout
1684
1685 Are you older than 18 years?
1686 \end_layout
1687
1688 \end_inset
1689
1690
1691 \end_layout
1692
1693 \begin_layout Standard
1694 The symbol is either specified as number or with the command
1695 \begin_inset Newline newline
1696 \end_inset
1697
1698
1699 \series bold
1700
1701 \backslash
1702 ding{number}
1703 \series default
1704
1705 \begin_inset Newline newline
1706 \end_inset
1707
1708 where 
1709 \series bold
1710 number
1711 \series default
1712  is one of the possible numbers listed in Table
1713 \begin_inset space ~
1714 \end_inset
1715
1716 2 of 
1717 \begin_inset CommandInset citation
1718 LatexCommand cite
1719 key "pifont"
1720
1721 \end_inset
1722
1723 .
1724 \end_layout
1725
1726 \begin_layout Itemize
1727 Combo box with dashed, colored border:
1728 \begin_inset VSpace defskip
1729 \end_inset
1730
1731
1732 \begin_inset Newline newline
1733 \end_inset
1734
1735
1736 \begin_inset Flex ChoiceMenu
1737 status open
1738
1739 \begin_layout Plain Layout
1740
1741 \begin_inset Argument 1
1742 status open
1743
1744 \begin_layout Plain Layout
1745 combo, default=Az
1746 \end_layout
1747
1748 \end_inset
1749
1750 Albania=Al, Armenia=Ar, Azerbaidschan=Az
1751 \begin_inset Argument 2
1752 status open
1753
1754 \begin_layout Plain Layout
1755 Country:
1756 \end_layout
1757
1758 \end_inset
1759
1760
1761 \end_layout
1762
1763 \end_inset
1764
1765
1766 \end_layout
1767
1768 \begin_layout Itemize
1769 Popdown box where only 2
1770 \begin_inset space ~
1771 \end_inset
1772
1773 entries are shown and where the last entry is preselected:
1774 \begin_inset VSpace defskip
1775 \end_inset
1776
1777
1778 \begin_inset Newline newline
1779 \end_inset
1780
1781
1782 \begin_inset Flex ChoiceMenu
1783 status open
1784
1785 \begin_layout Plain Layout
1786
1787 \begin_inset Argument 1
1788 status open
1789
1790 \begin_layout Plain Layout
1791 popdown, name=country2, value=Az
1792 \end_layout
1793
1794 \end_inset
1795
1796 Albania=Al, Armenia=Ar, Azerbaidschan=Az
1797 \begin_inset Argument 2
1798 status open
1799
1800 \begin_layout Plain Layout
1801 Country:
1802 \end_layout
1803
1804 \end_inset
1805
1806
1807 \end_layout
1808
1809 \end_inset
1810
1811
1812 \end_layout
1813
1814 \begin_layout Standard
1815 \begin_inset VSpace defskip
1816 \end_inset
1817
1818
1819 \begin_inset Note Greyedout
1820 status open
1821
1822 \begin_layout Plain Layout
1823
1824 \series bold
1825 Note
1826 \series default
1827  that the 
1828 \series bold
1829 borderstyle B
1830 \series default
1831  and 
1832 \series bold
1833 I
1834 \series default
1835  and also 
1836 \series bold
1837 color
1838 \series default
1839  has no effect for popdown boxes.
1840 \end_layout
1841
1842 \end_inset
1843
1844
1845 \end_layout
1846
1847 \begin_layout Itemize
1848 Radio box with inverted bevel border and symbol number
1849 \begin_inset space ~
1850 \end_inset
1851
1852 6 as checkmark:
1853 \begin_inset VSpace defskip
1854 \end_inset
1855
1856
1857 \begin_inset Newline newline
1858 \end_inset
1859
1860
1861 \begin_inset Flex ChoiceMenu
1862 status open
1863
1864 \begin_layout Plain Layout
1865
1866 \begin_inset Argument 1
1867 status open
1868
1869 \begin_layout Plain Layout
1870 radio
1871 \end_layout
1872
1873 \end_inset
1874
1875 male=m, female=f
1876 \begin_inset Argument 2
1877 status open
1878
1879 \begin_layout Plain Layout
1880 Sex:
1881 \end_layout
1882
1883 \end_inset
1884
1885
1886 \end_layout
1887
1888 \end_inset
1889
1890
1891 \end_layout
1892
1893 \begin_layout Itemize
1894 Push button with a bevel border and colored text:
1895 \begin_inset VSpace defskip
1896 \end_inset
1897
1898
1899 \begin_inset Newline newline
1900 \end_inset
1901
1902
1903 \begin_inset Flex PushButton
1904 status open
1905
1906 \begin_layout Plain Layout
1907
1908 \begin_inset Argument 1
1909 status open
1910
1911 \begin_layout Plain Layout
1912 onclick={app.alert("Why do you click this?")}
1913 \end_layout
1914
1915 \end_inset
1916
1917
1918 \backslash
1919 colorbox{lime}{
1920 \backslash
1921 textcolor{red}{Don't click on this button!!!}}
1922 \end_layout
1923
1924 \end_inset
1925
1926
1927 \end_layout
1928
1929 \begin_layout Standard
1930 \begin_inset VSpace defskip
1931 \end_inset
1932
1933
1934 \begin_inset Note Greyedout
1935 status open
1936
1937 \begin_layout Plain Layout
1938
1939 \series bold
1940 Note
1941 \series default
1942  that the 
1943 \series bold
1944 backgroundcolor
1945 \series default
1946  and
1947 \series bold
1948  color
1949 \series default
1950  has no effect for push, submit and reset buttons.
1951 \end_layout
1952
1953 \end_inset
1954
1955
1956 \end_layout
1957
1958 \begin_layout Standard
1959 As workaround use the command 
1960 \series bold
1961
1962 \backslash
1963 colorbox
1964 \series default
1965  as described in sec.
1966 \begin_inset space \thinspace{}
1967 \end_inset
1968
1969  5.7 
1970 \begin_inset Quotes eld
1971 \end_inset
1972
1973 Colored Boxes
1974 \begin_inset Quotes erd
1975 \end_inset
1976
1977  in LyX's 
1978 \emph on
1979 EmbeddedObjects
1980 \emph default
1981  manual and 
1982 \series bold
1983
1984 \backslash
1985 textcolor
1986 \series default
1987  that is used is used in the scheme
1988 \begin_inset Newline newline
1989 \end_inset
1990
1991
1992 \series bold
1993
1994 \backslash
1995 textcolor{color}{characters to color}
1996 \series default
1997
1998 \begin_inset Newline newline
1999 \end_inset
2000
2001 In the button above this code was used:
2002 \begin_inset Newline newline
2003 \end_inset
2004
2005
2006 \family sans
2007
2008 \backslash
2009 colorbox{lime}{
2010 \backslash
2011 textcolor{red}{Don't click on this button!!!}}
2012 \end_layout
2013
2014 \begin_layout Standard
2015 \begin_inset Note Greyedout
2016 status open
2017
2018 \begin_layout Plain Layout
2019
2020 \series bold
2021 Note
2022 \series default
2023  that the 
2024 \series bold
2025 height 
2026 \series default
2027 has no effect for push, submit and reset buttons.
2028 \end_layout
2029
2030 \end_inset
2031
2032
2033 \end_layout
2034
2035 \begin_layout Standard
2036 As workaround use 
2037 \series bold
2038
2039 \backslash
2040 raisebox
2041 \series default
2042  as described in sec.
2043 \begin_inset space \thinspace{}
2044 \end_inset
2045
2046  5.6.2 
2047 \begin_inset Quotes eld
2048 \end_inset
2049
2050 Vertical Alignment
2051 \begin_inset Quotes erd
2052 \end_inset
2053
2054  in LyX's 
2055 \emph on
2056 EmbeddedObjects
2057 \emph default
2058  manual.
2059  In the button below this code was used:
2060 \begin_inset Newline newline
2061 \end_inset
2062
2063
2064 \family sans
2065
2066 \backslash
2067 raisebox{-0.8cm}{}
2068 \backslash
2069 raisebox{1cm}{}Send your data via mail
2070 \end_layout
2071
2072 \begin_layout Standard
2073 \begin_inset Note Greyedout
2074 status open
2075
2076 \begin_layout Plain Layout
2077
2078 \series bold
2079 Note
2080 \series default
2081  that the 
2082 \series bold
2083 width 
2084 \series default
2085 has no effect for push, submit and reset buttons.
2086 \end_layout
2087
2088 \end_inset
2089
2090
2091 \end_layout
2092
2093 \begin_layout Standard
2094 As workaround use
2095 \series bold
2096  
2097 \backslash
2098 makebox
2099 \series default
2100  as described in sec.
2101 \begin_inset space \thinspace{}
2102 \end_inset
2103
2104  5.6.2 
2105 \begin_inset Quotes eld
2106 \end_inset
2107
2108 Vertical Alignment
2109 \begin_inset Quotes erd
2110 \end_inset
2111
2112  in LyX's 
2113 \emph on
2114 EmbeddedObjects
2115 \emph default
2116  manual.
2117  In the reset button below this code was used:
2118 \begin_inset Newline newline
2119 \end_inset
2120
2121
2122 \family sans
2123
2124 \backslash
2125 makebox[7cm]{Reset the form}
2126 \end_layout
2127
2128 \begin_layout Itemize
2129 Submit button with cyan background color and increased height:
2130 \begin_inset VSpace defskip
2131 \end_inset
2132
2133
2134 \begin_inset Newline newline
2135 \end_inset
2136
2137
2138 \begin_inset Flex SubmitButton
2139 status open
2140
2141 \begin_layout Plain Layout
2142
2143 \begin_inset Argument 1
2144 status open
2145
2146 \begin_layout Plain Layout
2147 name=submit2
2148 \end_layout
2149
2150 \end_inset
2151
2152
2153 \backslash
2154 colorbox{cyan}{
2155 \backslash
2156 raisebox{-0.8cm}{}
2157 \backslash
2158 raisebox{1cm}{}Send your data via mail}
2159 \end_layout
2160
2161 \end_inset
2162
2163
2164 \begin_inset VSpace bigskip
2165 \end_inset
2166
2167
2168 \end_layout
2169
2170 \begin_layout Itemize
2171 Reset button with a width of 7
2172 \begin_inset space \thinspace{}
2173 \end_inset
2174
2175 cm:
2176 \begin_inset VSpace defskip
2177 \end_inset
2178
2179
2180 \begin_inset Newline newline
2181 \end_inset
2182
2183
2184 \begin_inset Flex ResetButton
2185 status open
2186
2187 \begin_layout Plain Layout
2188
2189 \begin_inset Argument 1
2190 status open
2191
2192 \begin_layout Plain Layout
2193 name=reset2
2194 \end_layout
2195
2196 \end_inset
2197
2198
2199 \backslash
2200 makebox[7cm]{Reset the form}
2201 \end_layout
2202
2203 \end_inset
2204
2205
2206 \end_layout
2207
2208 \begin_layout Section
2209 Dynamic form fields
2210 \end_layout
2211
2212 \begin_layout Standard
2213 It is also possible to have dynamic form fields.
2214  This means that depending on the actions of the user fields can (dis)appear
2215  or change their appearance.
2216  To use this feature, add these lines to your document preamble:
2217 \end_layout
2218
2219 \begin_layout Standard
2220
2221 \series bold
2222
2223 \backslash
2224 usepackage[pdftex]{insdljs}
2225 \begin_inset Newline newline
2226 \end_inset
2227
2228
2229 \backslash
2230 pdfcatalog{/AA 
2231 \backslash
2232 the
2233 \backslash
2234 pdflastobj
2235 \backslash
2236 space 0 R}
2237 \end_layout
2238
2239 \begin_layout Standard
2240 Then add the necessary JavaScript code to your preamble or as TeX code to
2241  your document.
2242  For info about JavaScript, see its documentation, 
2243 \begin_inset CommandInset citation
2244 LatexCommand cite
2245 key "JavaScript"
2246
2247 \end_inset
2248
2249 .
2250 \end_layout
2251
2252 \begin_layout Standard
2253 \begin_inset ERT
2254 status collapsed
2255
2256 \begin_layout Plain Layout
2257
2258
2259 \backslash
2260 ifinsdljs
2261 \end_layout
2262
2263 \end_inset
2264
2265
2266 \begin_inset Note Note
2267 status open
2268
2269 \begin_layout Plain Layout
2270 The following section will only be displayed when the LaTeX package 
2271 \series bold
2272 insdljs
2273 \series default
2274  is installed.
2275 \end_layout
2276
2277 \end_inset
2278
2279
2280 \end_layout
2281
2282 \begin_layout Standard
2283 For the following choice menu this JavaScript code was used:
2284 \end_layout
2285
2286 \begin_layout Standard
2287 \begin_inset listings
2288 lstparams "language=TeX"
2289 inline false
2290 status open
2291
2292 \begin_layout Plain Layout
2293
2294
2295 \backslash
2296 begin{insDLJS}[exaaae]{exaaae}{JavaScript}
2297 \end_layout
2298
2299 \begin_layout Plain Layout
2300
2301  function validateTime(){
2302 \end_layout
2303
2304 \begin_layout Plain Layout
2305
2306   this.delay = true;
2307 \end_layout
2308
2309 \begin_layout Plain Layout
2310
2311   if((event.value == "u") || (event.value == "unlimited")) {
2312 \end_layout
2313
2314 \begin_layout Plain Layout
2315
2316    this.getField("from").display = display.hidden;
2317 \end_layout
2318
2319 \begin_layout Plain Layout
2320
2321    this.getField("to").display = display.hidden;
2322 \end_layout
2323
2324 \begin_layout Plain Layout
2325
2326   } else {
2327 \end_layout
2328
2329 \begin_layout Plain Layout
2330
2331    this.getField("from").display = display.visible;
2332 \end_layout
2333
2334 \begin_layout Plain Layout
2335
2336    this.getField("to").display = display.visible;
2337 \end_layout
2338
2339 \begin_layout Plain Layout
2340
2341    this.getField("from").setFocus();
2342 \end_layout
2343
2344 \begin_layout Plain Layout
2345
2346   }
2347 \end_layout
2348
2349 \begin_layout Plain Layout
2350
2351   this.delay = false;
2352 \end_layout
2353
2354 \begin_layout Plain Layout
2355
2356  }
2357 \end_layout
2358
2359 \begin_layout Plain Layout
2360
2361
2362 \backslash
2363 end{insDLJS}
2364 \end_layout
2365
2366 \end_inset
2367
2368
2369 \end_layout
2370
2371 \begin_layout Standard
2372 The 
2373 \family sans
2374 PDF
2375 \begin_inset space ~
2376 \end_inset
2377
2378 form
2379 \begin_inset space ~
2380 \end_inset
2381
2382 parameters
2383 \family default
2384  of the following choice menu are
2385 \begin_inset Newline newline
2386 \end_inset
2387
2388
2389 \series bold
2390 name=contract,radio,value=tl,default=tl,validate={validateTime();}
2391 \end_layout
2392
2393 \begin_layout Standard
2394 \begin_inset Flex ChoiceMenu
2395 status open
2396
2397 \begin_layout Plain Layout
2398
2399 \begin_inset Argument 1
2400 status open
2401
2402 \begin_layout Plain Layout
2403 name=contract,radio,value=tl,default=tl,validate={validateTime();}
2404 \end_layout
2405
2406 \end_inset
2407
2408 term-limited=tl, unlimited=u
2409 \begin_inset Argument 2
2410 status open
2411
2412 \begin_layout Plain Layout
2413 Job contract:
2414 \end_layout
2415
2416 \end_inset
2417
2418
2419 \end_layout
2420
2421 \end_inset
2422
2423
2424 \begin_inset VSpace defskip
2425 \end_inset
2426
2427
2428 \end_layout
2429
2430 \begin_layout Standard
2431 \begin_inset Tabular
2432 <lyxtabular version="3" rows="3" columns="2">
2433 <features rotate="0" tabularvalignment="middle">
2434 <column alignment="left" valignment="top">
2435 <column alignment="center" valignment="top">
2436 <row>
2437 <cell alignment="left" valignment="top" usebox="none">
2438 \begin_inset Text
2439
2440 \begin_layout Plain Layout
2441 From:
2442 \end_layout
2443
2444 \end_inset
2445 </cell>
2446 <cell alignment="center" valignment="top" usebox="none">
2447 \begin_inset Text
2448
2449 \begin_layout Plain Layout
2450 \begin_inset Flex TextField
2451 status open
2452
2453 \begin_layout Plain Layout
2454
2455 \begin_inset Argument 1
2456 status open
2457
2458 \begin_layout Plain Layout
2459 name=from,width=10em
2460 \end_layout
2461
2462 \end_inset
2463
2464
2465 \end_layout
2466
2467 \end_inset
2468
2469
2470 \end_layout
2471
2472 \end_inset
2473 </cell>
2474 </row>
2475 <row>
2476 <cell alignment="center" valignment="top" usebox="none">
2477 \begin_inset Text
2478
2479 \begin_layout Plain Layout
2480
2481 \end_layout
2482
2483 \end_inset
2484 </cell>
2485 <cell alignment="center" valignment="top" usebox="none">
2486 \begin_inset Text
2487
2488 \begin_layout Plain Layout
2489 \begin_inset VSpace -1.5mm
2490 \end_inset
2491
2492
2493 \end_layout
2494
2495 \end_inset
2496 </cell>
2497 </row>
2498 <row>
2499 <cell alignment="left" valignment="top" usebox="none">
2500 \begin_inset Text
2501
2502 \begin_layout Plain Layout
2503 To:
2504 \end_layout
2505
2506 \end_inset
2507 </cell>
2508 <cell alignment="center" valignment="top" usebox="none">
2509 \begin_inset Text
2510
2511 \begin_layout Plain Layout
2512 \begin_inset Flex TextField
2513 status open
2514
2515 \begin_layout Plain Layout
2516
2517 \begin_inset Argument 1
2518 status open
2519
2520 \begin_layout Plain Layout
2521 name=to,width=10em
2522 \end_layout
2523
2524 \end_inset
2525
2526
2527 \end_layout
2528
2529 \end_inset
2530
2531
2532 \end_layout
2533
2534 \end_inset
2535 </cell>
2536 </row>
2537 </lyxtabular>
2538
2539 \end_inset
2540
2541
2542 \end_layout
2543
2544 \begin_layout Standard
2545 \begin_inset ERT
2546 status collapsed
2547
2548 \begin_layout Plain Layout
2549
2550
2551 \backslash
2552 else
2553 \end_layout
2554
2555 \end_inset
2556
2557
2558 \begin_inset Note Note
2559 status open
2560
2561 \begin_layout Plain Layout
2562 The following will be displayed when the LaTeX package 
2563 \series bold
2564 insdljs
2565 \series default
2566  is not installed:
2567 \end_layout
2568
2569 \end_inset
2570
2571
2572 \end_layout
2573
2574 \begin_layout Standard
2575 You need to install the package 
2576 \series bold
2577 insdljs
2578 \series default
2579  to see the content of this section in the output.
2580 \end_layout
2581
2582 \begin_layout Standard
2583 \begin_inset ERT
2584 status collapsed
2585
2586 \begin_layout Plain Layout
2587
2588
2589 \backslash
2590 fi
2591 \end_layout
2592
2593 \end_inset
2594
2595
2596 \end_layout
2597
2598 \begin_layout End PDF Form
2599 \begin_inset Note Note
2600 status open
2601
2602 \begin_layout Plain Layout
2603 keep this emtpy
2604 \end_layout
2605
2606 \end_inset
2607
2608
2609 \end_layout
2610
2611 \begin_layout Section
2612 General hints
2613 \end_layout
2614
2615 \begin_layout Itemize
2616 To be able to use all kinds of colors and color definitions you must load
2617  the LaTeX package 
2618 \series bold
2619 xcolor
2620 \series default
2621  in the document preamble this way:
2622 \begin_inset Newline newline
2623 \end_inset
2624
2625
2626 \series bold
2627
2628 \backslash
2629 usepackage[svgnames,rgb]{xcolor}
2630 \end_layout
2631
2632 \begin_layout Itemize
2633 To see in 
2634 \emph on
2635 Adobe Reader
2636 \emph default
2637  and 
2638 \emph on
2639 Acrobat
2640 \emph default
2641  custom background colors you must disable in these programs to highlight
2642  the available form fields in the PDF.
2643 \end_layout
2644
2645 \begin_layout Bibliography
2646 \begin_inset CommandInset bibitem
2647 LatexCommand bibitem
2648 key "JavaScript"
2649
2650 \end_inset
2651
2652
2653 \begin_inset CommandInset href
2654 LatexCommand href
2655 name "JavaScript reference"
2656 target "https://developer.mozilla.org/en/docs/Web/JavaScript/Reference"
2657
2658 \end_inset
2659
2660
2661 \end_layout
2662
2663 \begin_layout Bibliography
2664 \begin_inset CommandInset bibitem
2665 LatexCommand bibitem
2666 key "hyperref"
2667
2668 \end_inset
2669
2670
2671 \begin_inset CommandInset href
2672 LatexCommand href
2673 name "Documentation"
2674 target "http://mirrors.ctan.org/macros/latex/contrib/hyperref/doc/manual.pdf"
2675
2676 \end_inset
2677
2678  of the LaTeX package 
2679 \series bold
2680 hyperref
2681 \series default
2682 .
2683 \end_layout
2684
2685 \begin_layout Bibliography
2686 \begin_inset CommandInset bibitem
2687 LatexCommand bibitem
2688 key "pifont"
2689
2690 \end_inset
2691
2692
2693 \begin_inset CommandInset href
2694 LatexCommand href
2695 name "Documentation"
2696 target "http://mirrors.ctan.org/macros/latex/required/psnfss/psnfss2e.pdf"
2697
2698 \end_inset
2699
2700  of the LaTeX package 
2701 \series bold
2702 pifont
2703 \series default
2704 .
2705 \end_layout
2706
2707 \end_body
2708 \end_document