| <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>form</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.0"><link rel="up" href="form.html" title="Form: An HTML Form Fields Generation Utility"><link rel="prev" href="form.html" title="Form: An HTML Form Fields Generation Utility"><link rel="next" href="calendar_package.html" title="Calendar Package"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">form</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="form.html"><img src="images/prev.png" alt="Prev"></a> </td><th width="60%" align="center">Form: An HTML Form Fields Generation Utility</th><td width="20%" align="right"> <a accesskey="n" href="calendar_package.html"><img src="images/next.png" alt="Next"></a></td></tr></table></div><div class="refentry"><a name="form_package"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>form — a Tcl command object for creating HTML forms</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">form</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>form_name</code></em></span> ?<span style="font-family:monospace; font-weight: bold;">-option1 <em class="replaceable"><code>value_1</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;">-option2 <em class="replaceable"><code>value_2</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;">...</span>?</div></div></div><div class="refsect1"><a name="idm3482"></a><p style="width:90%"> |
| creates and returns a new Tcl command named <em class="replaceable"><code>form_name</code></em>. |
| </p><div class="refsect2"><a name="idm3486"></a><h3>Options</h3><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-method</span> ?<span style="font-family:monospace; font-weight: bold;">post|get</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| The http method for sending the form data back to the server. |
| Possible values are get or post |
| </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-name</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>form_name</code></em></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| a name for the form being created: this value becomes the value of the |
| attribute 'name' in the <form> tag. |
| </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-defaults</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>default_values</code></em></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| an array of default values to be assigned to the fields of the form. |
| Every name in the array is matched with an input field, when |
| a given field gets added to the form it is initialized with the |
| value of the corresponding variable in the array. |
| This option works well in conjuction with the |
| <span style="font-family:monospace"><span class="command"><strong>load_response</strong></span></span> command of Rivet when default |
| values come from another form. |
| </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-action</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>URL</code></em></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| The URL the data are being sent to. If no ?<span style="font-family:monospace; font-weight: bold;">-action</span>? switch is specified |
| the data are sent to the form's URL. |
| </div></div></dd></dl></div></div></div><div class="refsect1"><a name="idm3518"></a><h2>Form Object Commands</h2><p style="width:90%"> |
| Form object commands follow the usual syntax of Tcl commands with a ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>subcommand</code></em></span>? argument playing the |
| role of a switch among various functionalities of the command. Form objects also need the ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>name</code></em></span>? parameter |
| which is to become the value of the 'name' attribute in an input field. This argument is the key that has to be |
| used by the server-side script to retrieve the input field value. |
| </p><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> |
| form_object <span style="font-family:monospace; font-weight: bold;">subcommand</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">-option1 <em class="replaceable"><code>value1</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;">-option2 <em class="replaceable"><code>value2</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;">...</span>?</div></div></div></dd></dl></div><p style="width:90%"> |
| Options passed to a subcommand are copied into the tag as attribute="value" pairs. |
| Some subcommands (e.g. form, radiobuttons and checkboxes) treat specific options in a way |
| that fits the specific organization and function of these fields. |
| </p><p style="width:90%"> |
| Exceptions to this general syntax are the <span style="font-family:monospace"><span class="command"><strong>field</strong></span></span> and <span style="font-family:monospace"><span class="command"><strong>end</strong></span></span> subcommands. |
| <span style="font-family:monospace"><span class="command"><strong>field</strong></span></span> is an abstract input field creation method and requires an additional |
| parameter specifiyng the type of field to create. Every concrete input field generation command |
| uses this subcommand internally to print the final html. |
| </p></div><div class="refsect1"><a name="idm3541"></a><h2>Subcommands</h2><div class="refsect2"><a name="idm3543"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">start</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">-method <em class="replaceable"><code>get | post</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;">-name <em class="replaceable"><code>form_name</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;">-defaults <em class="replaceable"><code>default_values</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;">-action <em class="replaceable"><code>URL</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Print the <form> tag with all its attributes. |
| This command must be called as first in the form generation |
| process. The following is a sample of code creating a form named 'formname' whose data will |
| be sent via the GET method. Initial form fields values will be obtained from array |
| <code class="varname">response</code> |
| </div><pre class="programlisting"> |
| form myform -defaults response -method get -name formname |
| myform start |
| myform text text_entry -size 20 |
| myform select option_selected -values {opt1 opt2 opt3 opt4} |
| myform submit submit -value Search |
| myform end</pre><div style="margin-bottom:1.5ex ; padding .5ex"> |
| The code prints a form that sends a text entry content and the option value |
| associated with a radiobutton. The URL of the server script is the same that |
| created the form. Use the ?<span style="font-family:monospace; font-weight: bold;">-url</span>? option to specify a different url. |
| </div></div></dd></dl></div><div class="refsect3"><a name="idm3564"></a><div style="padding:4 ; margin-top:3 ; margin-left: 5%;">Options</div><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-left: 5%; margin-bottom:3 ; width:70%;"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-method</span> ?<span style="font-family:monospace; font-weight: bold;">post|get</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| The method to be used to encode the form data. |
| Possible values are get or post |
| </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-left: 5%; margin-bottom:3 ; width:70%;"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-name</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>form_name</code></em></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| a name for the form being generated: this value becomes the value of the |
| attribute 'name' in the <form> tag. |
| </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-left: 5%; margin-bottom:3 ; width:70%;"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-defaults</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>default_values</code></em></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| an array of default values to be assigned to the fields of the form. |
| Every name in the array is matched with an input field, when |
| a given field gets added to the form it is initialized with the |
| value of the corresponding variable in the array. |
| This option works well in conjuction with the |
| <span style="font-family:monospace"><span class="command"><strong>load_response</strong></span></span> command of Rivet when default values |
| come from another form. |
| </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-left: 5%; margin-bottom:3 ; width:70%;"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-action</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>URL</code></em></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| The URL the data will be sent to. If no ?<span style="font-family:monospace; font-weight: bold;">-action</span>? switch is specified |
| the data are sent to the form's URL. |
| </div></div></dd></dl></div></div></div><div class="refsect2"><a name="idm3596"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">end</span> </div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Print the </form> closing tag. This command must |
| be called last in the form generation process |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3603"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">field</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">type</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Print a field of the given ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>type</code></em></span>? and ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>name</code></em></span>?, |
| including any default key-value pairs defined for this field |
| type and optional key-value pairs included with the statement |
| </div></div></dd></dl></div><div class="refsect3"><a name="idm3617"></a><div style="padding:4 ; margin-top:3 ; margin-left: 5%;">Options</div><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-left: 5%; margin-bottom:3 ; width:70%;"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-opt1</span> ?<span style="font-family:monospace; font-weight: bold;">val1</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Option description |
| </div></div></dd></dl></div></div></div><div class="refsect2"><a name="idm3626"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">radiobuttons</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">-values <em class="replaceable"><code>values</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;">-labels <em class="replaceable"><code>labels</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| the <span style="font-family:monospace"><span class="command"><strong>radiobutton</strong></span></span> creates a whole radiobutton group |
| with the values and labels specified in the argument list. |
| If no ?<span style="font-family:monospace; font-weight: bold;">-labels</span>? switch is |
| passed to the subcommand the values are printed as labels of |
| the radiobutton. |
| </div><div class="refsect3"><a name="idm3641"></a><div style="padding:4 ; margin-top:3 ; margin-left: 5%;">Options</div><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-left: 5%; margin-bottom:3 ; width:70%;"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-values</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>values_list</code></em></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| List of values associated with the radiobuttons to be displayed |
| </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-left: 5%; margin-bottom:3 ; width:70%;"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-labels</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>labels_list</code></em></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| List of labels to be printed with every radiobutton. There must |
| be a label for every radiobutton |
| </div></div></dd></dl></div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Example: |
| </div><pre class="programlisting"> |
| form myform -defaults response -method get -name formname |
| myform start |
| myform text text_entry -size 20 |
| myform radiobuttons fruit -values {big medium small} \ |
| -labels {Watermelon Orange Strawberry} \ |
| -class myradiobclass |
| myform submit submit -value Search |
| myform end</pre><div style="margin-bottom:1.5ex ; padding .5ex"> |
| will print the following HTML code. |
| </div><pre class="programlisting"> |
| <input type="radio" name="fruit" class="myradiobclass" value="big" />Watermelon |
| <input type="radio" name="fruit" class="myradiobclass" value="medium" />Orange |
| <input type="radio" name="fruit" class="myradiobclass" value="small" />Strawberry |
| </pre><div style="margin-bottom:1.5ex ; padding .5ex"> |
| if the <code class="varname">response</code> array has a variable for the name 'fruit' the corresponding |
| radiobutton field is automatically checked. The options ?<span style="font-family:monospace; font-weight: bold;">values</span>? and ?<span style="font-family:monospace; font-weight: bold;">labels</span>? |
| are used internally and don't get into the tag attributes. If a ?<span style="font-family:monospace; font-weight: bold;">labels</span>? |
| option is not given, labels are assigned using the ?<span style="font-family:monospace; font-weight: bold;">values</span>? list. |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3668"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">checkbox</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">-label <em class="replaceable"><code>label</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;">-value <em class="replaceable"><code>value</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| The <span style="font-family:monospace; font-weight: bold;">checkbox</span> subcommand emits a checkbox |
| type input field with the name, label and value attributes set |
| according to the parameters passed to the subcommand. |
| </div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Example: |
| </div><pre class="programlisting">form myform -defaults response -method get -name formname -action <form_url> |
| myform start |
| myform checkbox options -value opt1 -label "Option 1" |
| myform checkbox options -value opt2 -label "Option 2" |
| myform checkbox options -value opt3 -label "Option 3" |
| myform checkbox options -value opt4 -label "Option 4" |
| myform submit save_tps -value "Send Options" |
| myform end |
| myform destroy</pre><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Provided opt2 was in response array (in the list valued 'options' variable) that |
| initialized the form, the output would look like this |
| </div><pre class="programlisting"><form action="<form_url>" method="get" name="formname"> |
| <input type="checkbox" name="options" id="autogen_1" label="Option 1" value="sopt1" /><label for="autogen_1">Option 1</label> |
| <input type="checkbox" name="options" id="autogen_2" label="Option 2" value="sopt2" /><label for="autogen_2">Option 2</label> |
| <input type="checkbox" name="options" id="autogen_3" label="Option 3" value="sopt3" /><label for="autogen_3">Option 3</label> |
| <input type="checkbox" name="options" id="autogen_4" label="Option 4" value="sopt4" /><label for="autogen_4">Option 4</label> |
| <input type="submit" name="submit" value="Send" /> |
| </form></pre></div></dd></dl></div></div><div class="refsect2"><a name="idm3686"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">checkboxes</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">-labels <em class="replaceable"><code>labels_list</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;">-values <em class="replaceable"><code>values_list</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| The <span style="font-family:monospace; font-weight: bold;">checkboxes</span> is an extended form |
| of the <span style="font-family:monospace; font-weight: bold;">checkbox</span> subcommand. |
| <span style="font-family:monospace; font-weight: bold;">checkboxes</span> |
| prints as many checkboxes as the number of elements in the |
| ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>labels_list</code></em></span>? argument |
| </div><div class="refsect3"><a name="idm3704"></a><div style="padding:4 ; margin-top:3 ; margin-left: 5%;">Options</div><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-left: 5%; margin-bottom:3 ; width:70%;"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-values</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>values_list</code></em></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| List of values associated with the checkboxes to be displayed |
| </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-left: 5%; margin-bottom:3 ; width:70%;"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-labels</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>labels_list</code></em></span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| List of labels to be printed with every checkbox. There must |
| be a label for every checkbox |
| </div></div></dd></dl></div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Example: |
| </div><pre class="programlisting">form myform -defaults response -method post -action <form_url> |
| myform start |
| myform checkboxes options -values {opt1 opt2 opt3 opt4} -labels {"Option 1" "Option 2" "Option 3" "Option 4"} |
| myform submit save_tps -value "Send Options" |
| myform end |
| myform destroy</pre><div style="margin-bottom:1.5ex ; padding .5ex"> |
| will print the following HTML code |
| </div><pre class="programlisting"><form action="<form_url>" method="post"> |
| <input type="checkbox" name="options" id="autogen_1" label="Option 1" value="opt1" /><label for="autogen_1">Option 1</label> |
| <input type="checkbox" name="options" id="autogen_2" label="Option 2" value="opt2" /><label for="autogen_2">Option 2</label> |
| <input type="checkbox" name="options" id="autogen_3" label="Option 3" value="opt3" /><label for="autogen_3">Option 3</label> |
| <input type="checkbox" name="options" id="autogen_4" label="Option 4" value="opt4" /><label for="autogen_4">Option 4</label> |
| <input type="submit" name="save_tps" value="Send Options" /> |
| </form></pre></div></dd></dl></div></div><div class="refsect2"><a name="idm3725"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">password</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Same as text, but the input is obfuscated so as not to reveal the text being typed |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3734"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">hidden</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| hidden input element: typicall embedded in a form in order to |
| pass status variables. |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3743"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">submit</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| emits the code for a classical HTML submit button. Example: the following |
| code |
| </div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| <pre class="programlisting"> |
| form myform -defaults response -method get -name feedsearch |
| myform start |
| myform submit submit -value Search</pre> |
| </div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Would emit a form like this |
| </div><pre class="programlisting"> |
| <form...> |
| <input type="submit" name="submit" value="Search" /> |
| </form></pre></div></dd></dl></div></div><div class="refsect2"><a name="idm3756"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">button</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| emits the code for a button field having ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>name</code></em></span>? as name |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3767"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">reset</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Classical HTML reset button that resets the input fields |
| back to their initial values |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3776"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">image</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Emits an image input field |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3785"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">radio</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Emits a radiobutton input field |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3794"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">color</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Emits an HTML 5 "color" form field |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3803"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">date</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Emits an HTML 5 "date" form field |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3812"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">datetime</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Emits an HTML 5 "datetime" form field |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3821"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">datetime_local</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Emits an HTML 5 "datetime_local" form field |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3830"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">email</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Emits an HTML 5 "email" form field |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3839"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">file</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Emits an HTML 5 "file" form field |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3848"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">month</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Emits an HTML 5 "month" form field |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3857"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">number</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Emits an HTML 5 "number" form field |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3866"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">range</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Emits an HTML 5 "range" form field |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3875"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">search</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Emits an HTML 5 "search" form field |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3884"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">tel</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Emits an HTML 5 "tel" form field |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3893"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">time</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Emits an HTML 5 "time" form field |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3902"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">url</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Emits an HTML 5 "url" form field |
| </div></div></dd></dl></div></div><div class="refsect2"><a name="idm3911"></a><div class="variablelist"><dl class="variablelist"><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">week</span> ?<span style="font-family:monospace; font-weight: bold;">name</span>? ?<span style="font-family:monospace; font-weight: bold;">args</span>?</div></div><div style="margin-bottom:1.5ex ; padding .5ex"> |
| Emits an HTML 5 "week" form field |
| </div></div></dd></dl></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="form.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="form.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="calendar_package.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Form: An HTML Form Fields Generation Utility </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Calendar Package</td></tr></table></div></body></html> |