1javascript(n)           HTML and Java Script Generation          javascript(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       javascript - Procedures to generate HTML and Java Script structures.
9

SYNOPSIS

11       package require Tcl  8
12
13       package require javascript  ?1.0.2?
14
15       ::javascript::makeSelectorWidget  id leftLabel leftValueList rightLabel
16       rightValueList rightNameList ?length? ?minWidth?
17
18       ::javascript::makeSubmitButton name value
19
20       ::javascript::makeProtectedSubmitButton name value msg
21
22       ::javascript::makeMasterButton master value slavePattern boolean
23
24       ::javascript::makeParentCheckbox parentName childName
25
26       ::javascript::makeChildCheckbox parentName childName
27
28______________________________________________________________________________
29

DESCRIPTION

31       The ::javascript package provides commands that generate HTML and  Java
32       Script  code.   These commands typically return an HTML string as their
33       result.  In particular, they do not output their result to stdout.
34
35       ::javascript::makeSelectorWidget id leftLabel leftValueList  rightLabel
36       rightValueList rightNameList ?length? ?minWidth?
37              Construct HTML code to create a dual-multi-selection megawidget.
38              This megawidget consists  of  two  side-by-side  multi-selection
39              boxes  separated  by a left arrow and a right arrow button.  The
40              right arrow button moves all items selected in the left  box  to
41              the  right  box.  The left arrow button moves all items selected
42              in the right box to the left box.  The id argument is the suffix
43              of  all HTML objects in this megawidget.  The leftLabel argument
44              is the text that appears above  the  left  selection  box.   The
45              leftValueList argument is the values of items in the left selec‐
46              tion box.  The leftNameList argument is the names to  appear  in
47              the  left  selection  box.   The rightLabel argument is the text
48              that appears above the right selection box.  The  rightValueList
49              argument is the values of items in the right selection box.  The
50              rightNameList argument is the  names  to  appear  in  the  right
51              selection  box.   The  length argument (optional) determines the
52              number of elts to show before adding a  vertical  scrollbar;  it
53              defaults  to  8.  The minWidth argument (optional) is the number
54              of spaces to determine the minimum box width; it defaults to 32.
55
56       ::javascript::makeSubmitButton name value
57              Create an HTML submit button that resets a hidden field for each
58              registered  multi-selection  box.  The name argument is the name
59              of the HTML button object to create.  The value argument is  the
60              label of the HTML button object to create.
61
62       ::javascript::makeProtectedSubmitButton name value msg
63              Create  an  HTML submit button that prompts the user with a con‐
64              tinue/cancel shutdown warning before the form is submitted.  The
65              name  argument  is the name of the HTML button object to create.
66              The value argument is the label of the  HTML  button  object  to
67              create. The msg argument is the message to display when the but‐
68              ton is pressed.
69
70       ::javascript::makeMasterButton master value slavePattern boolean
71              Create an HTML button that sets its slave checkboxs to the bool‐
72              ean  value.  The master argument is the name of the child's par‐
73              ent html checkbox object.  The value argument is  the  value  of
74              the  master.   The  slaves  argument  is  the name of child html
75              checkbox object to create.  The boolean  argument  is  the  java
76              script  boolean  value  that will be given to all the slaves; it
77              must be "true" or "false".
78
79       ::javascript::makeParentCheckbox parentName childName
80              Create an HTML checkbox and tie its value to that of  its  child
81              checkbox.   If  the  parent is unchecked, the child is automati‐
82              cally unchecked.  The parentName argument is the name of  parent
83              html  checkbox  object  to create. The childName argument is the
84              name of the parent's child html checkbox object.
85
86       ::javascript::makeChildCheckbox parentName childName
87              Create an HTML checkbox and tie its value to that of its  parent
88              checkbox.   If the child is checked, the parent is automatically
89              checked.  The parentName argument is the  name  of  the  child's
90              parent html checkbox object.  The childName argument is the name
91              of child html checkbox object to create.
92

BUGS, IDEAS, FEEDBACK

94       This document, and the package it describes, will  undoubtedly  contain
95       bugs and other problems.  Please report such in the category javascript
96       of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist].   Please
97       also  report any ideas for enhancements you may have for either package
98       and/or documentation.
99
100       When proposing code changes, please provide unified diffs, i.e the out‐
101       put of diff -u.
102
103       Note  further  that  attachments  are  strongly  preferred over inlined
104       patches. Attachments can be made by going  to  the  Edit  form  of  the
105       ticket  immediately  after  its  creation, and then using the left-most
106       button in the secondary navigation bar.
107

SEE ALSO

109       html, ncgi
110

KEYWORDS

112       checkbox, html, javascript, selectionbox, submitbutton
113

CATEGORY

115       CGI programming
116
117
118
119tcllib                               1.0.2                       javascript(n)
Impressum