1 2[//000000001]: # (javascript \- HTML and Java Script Generation) 3[//000000002]: # (Generated from file 'javascript\.man' by tcllib/doctools with format 'markdown') 4[//000000003]: # (javascript\(n\) 1\.0\.2 tcllib "HTML and Java Script Generation") 5 6<hr> [ <a href="../../../../toc.md">Main Table Of Contents</a> | <a 7href="../../../toc.md">Table Of Contents</a> | <a 8href="../../../../index.md">Keyword Index</a> | <a 9href="../../../../toc0.md">Categories</a> | <a 10href="../../../../toc1.md">Modules</a> | <a 11href="../../../../toc2.md">Applications</a> ] <hr> 12 13# NAME 14 15javascript \- Procedures to generate HTML and Java Script structures\. 16 17# <a name='toc'></a>Table Of Contents 18 19 - [Table Of Contents](#toc) 20 21 - [Synopsis](#synopsis) 22 23 - [Description](#section1) 24 25 - [Bugs, Ideas, Feedback](#section2) 26 27 - [See Also](#seealso) 28 29 - [Keywords](#keywords) 30 31 - [Category](#category) 32 33# <a name='synopsis'></a>SYNOPSIS 34 35package require Tcl 8 36package require javascript ?1\.0\.2? 37 38[__::javascript::makeSelectorWidget__ *id leftLabel leftValueList rightLabel rightValueList rightNameList* ?*length*? ?*minWidth*?](#1) 39[__::javascript::makeSubmitButton__ *name value*](#2) 40[__::javascript::makeProtectedSubmitButton__ *name value msg*](#3) 41[__::javascript::makeMasterButton__ *master value slavePattern boolean*](#4) 42[__::javascript::makeParentCheckbox__ *parentName childName*](#5) 43[__::javascript::makeChildCheckbox__ *parentName childName*](#6) 44 45# <a name='description'></a>DESCRIPTION 46 47The __::javascript__ package provides commands that generate HTML and Java 48Script code\. These commands typically return an HTML string as their result\. In 49particular, they do not output their result to __stdout__\. 50 51 - <a name='1'></a>__::javascript::makeSelectorWidget__ *id leftLabel leftValueList rightLabel rightValueList rightNameList* ?*length*? ?*minWidth*? 52 53 Construct HTML code to create a dual\-multi\-selection megawidget\. This 54 megawidget consists of two side\-by\-side multi\-selection boxes separated by a 55 left arrow and a right arrow button\. The right arrow button moves all items 56 selected in the left box to the right box\. The left arrow button moves all 57 items selected in the right box to the left box\. The *id* argument is the 58 suffix of all HTML objects in this megawidget\. The *leftLabel* argument is 59 the text that appears above the left selection box\. The *leftValueList* 60 argument is the values of items in the left selection box\. The 61 *leftNameList* argument is the names to appear in the left selection box\. 62 The *rightLabel* argument is the text that appears above the right 63 selection box\. The *rightValueList* argument is the values of items in the 64 right selection box\. The *rightNameList* argument is the names to appear 65 in the right selection box\. The *length* argument \(optional\) determines 66 the number of elts to show before adding a vertical scrollbar; it defaults 67 to 8\. The *minWidth* argument \(optional\) is the number of spaces to 68 determine the minimum box width; it defaults to 32\. 69 70 - <a name='2'></a>__::javascript::makeSubmitButton__ *name value* 71 72 Create an HTML submit button that resets a hidden field for each registered 73 multi\-selection box\. The *name* argument is the name of the HTML button 74 object to create\. The *value* argument is the label of the HTML button 75 object to create\. 76 77 - <a name='3'></a>__::javascript::makeProtectedSubmitButton__ *name value msg* 78 79 Create an HTML submit button that prompts the user with a continue/cancel 80 shutdown warning before the form is submitted\. The *name* argument is the 81 name of the HTML button object to create\. The *value* argument is the 82 label of the HTML button object to create\. The *msg* argument is the 83 message to display when the button is pressed\. 84 85 - <a name='4'></a>__::javascript::makeMasterButton__ *master value slavePattern boolean* 86 87 Create an HTML button that sets its slave checkboxs to the boolean value\. 88 The *master* argument is the name of the child's parent html checkbox 89 object\. The *value* argument is the value of the master\. The *slaves* 90 argument is the name of child html checkbox object to create\. The 91 *boolean* argument is the java script boolean value that will be given to 92 all the slaves; it must be "true" or "false"\. 93 94 - <a name='5'></a>__::javascript::makeParentCheckbox__ *parentName childName* 95 96 Create an HTML checkbox and tie its value to that of its child checkbox\. If 97 the parent is unchecked, the child is automatically unchecked\. The 98 *parentName* argument is the name of parent html checkbox object to 99 create\. The *childName* argument is the name of the parent's child html 100 checkbox object\. 101 102 - <a name='6'></a>__::javascript::makeChildCheckbox__ *parentName childName* 103 104 Create an HTML checkbox and tie its value to that of its parent checkbox\. If 105 the child is checked, the parent is automatically checked\. The 106 *parentName* argument is the name of the child's parent html checkbox 107 object\. The *childName* argument is the name of child html checkbox object 108 to create\. 109 110# <a name='section2'></a>Bugs, Ideas, Feedback 111 112This document, and the package it describes, will undoubtedly contain bugs and 113other problems\. Please report such in the category *javascript* of the 114[Tcllib Trackers](http://core\.tcl\.tk/tcllib/reportlist)\. Please also report 115any ideas for enhancements you may have for either package and/or documentation\. 116 117When proposing code changes, please provide *unified diffs*, i\.e the output of 118__diff \-u__\. 119 120Note further that *attachments* are strongly preferred over inlined patches\. 121Attachments can be made by going to the __Edit__ form of the ticket 122immediately after its creation, and then using the left\-most button in the 123secondary navigation bar\. 124 125# <a name='seealso'></a>SEE ALSO 126 127[html](\.\./html/html\.md), [ncgi](\.\./ncgi/ncgi\.md) 128 129# <a name='keywords'></a>KEYWORDS 130 131[checkbox](\.\./\.\./\.\./\.\./index\.md\#checkbox), 132[html](\.\./\.\./\.\./\.\./index\.md\#html), 133[javascript](\.\./\.\./\.\./\.\./index\.md\#javascript), 134[selectionbox](\.\./\.\./\.\./\.\./index\.md\#selectionbox), 135[submitbutton](\.\./\.\./\.\./\.\./index\.md\#submitbutton) 136 137# <a name='category'></a>CATEGORY 138 139CGI programming 140