Add to git.
[monolith.git] / doc / new_ml_form.3.html
1 <html>
2 <head>
3 <meta name="generator" content="groff -Thtml, see www.gnu.org">
4 <meta name="Content-Style" content="text/css">
5 <title>new_ml_form</title>
6 </head>
7 <body>
8
9 <h1 align=center>new_ml_form</h1>
10 <a href="#NAME">NAME</a><br>
11 <a href="#SYNOPSIS">SYNOPSIS</a><br>
12 <a href="#DESCRIPTION">DESCRIPTION</a><br>
13 <a href="#AUTHOR">AUTHOR</a><br>
14 <a href="#LICENSE">LICENSE</a><br>
15 <a href="#VERSION">VERSION</a><br>
16 <a href="#SEE ALSO">SEE ALSO</a><br>
17
18 <hr>
19 <!-- Creator     : groff version 1.17.2 -->
20 <!-- CreationDate: Sat Aug 31 18:06:10 2002 -->
21 <a name="NAME"></a>
22 <h2>NAME</h2>
23 <table width="100%" border=0 rules="none" frame="void"
24        cols="2" cellspacing="0" cellpadding="0">
25 <tr valign="top" align="left">
26 <td width="10%"></td><td width="90%">
27 new_ml_form - monolith form widget</td></table>
28 <a name="SYNOPSIS"></a>
29 <h2>SYNOPSIS</h2>
30
31 <table width="100%" border=0 rules="none" frame="void"
32        cols="2" cellspacing="0" cellpadding="0">
33 <tr valign="top" align="left">
34 <td width="10%"></td><td width="90%">
35 <pre><b>#include &lt;ml_form.h&gt;
36
37 ml_form new_ml_form (pool pool);
38 </b></pre></td></table>
39 <a name="DESCRIPTION"></a>
40 <h2>DESCRIPTION</h2>
41
42 <table width="100%" border=0 rules="none" frame="void"
43        cols="2" cellspacing="0" cellpadding="0">
44 <tr valign="top" align="left">
45 <td width="10%"></td><td width="90%">
46 A monolith form widget is a low-level widget for handling
47 input of text fields, check buttons, radio buttons and so
48 on, collected together into a single form on a
49 page.</td></table>
50
51 <table width="100%" border=0 rules="none" frame="void"
52        cols="2" cellspacing="0" cellpadding="0">
53 <tr valign="top" align="left">
54 <td width="10%"></td><td width="90%">
55 A form should contain a mixture of input widgets and
56 ordinary widgets. Since the form widget itself can only be
57 packed with a single widget, normally you would pack a
58 layout widget directly into the form, and then a mixture of
59 labels and input widgets into the layout
60 widget.</td></table>
61
62 <table width="100%" border=0 rules="none" frame="void"
63        cols="2" cellspacing="0" cellpadding="0">
64 <tr valign="top" align="left">
65 <td width="10%"></td><td width="90%">
66 One or more of the widgets packed into the form can be a
67 submit button (see <b>new_ml_form_submit(3)</b>). Pressing
68 on the submit button causes the form's callback function to
69 be called, and in this function the values entered into the
70 other input widgets can be read. It is recommended that all
71 forms contain at least one submit button, because the effect
72 of creating a form with no submit buttons is
73 browser-dependent, and can mean that the form cannot be
74 submitted.</td></table>
75
76 <table width="100%" border=0 rules="none" frame="void"
77        cols="2" cellspacing="0" cellpadding="0">
78 <tr valign="top" align="left">
79 <td width="10%"></td><td width="90%">
80 Forms cannot be nested (a form widget cannot contain another
81 form widget inside itself). This is a limitation of
82 HTML.</td></table>
83
84 <table width="100%" border=0 rules="none" frame="void"
85        cols="2" cellspacing="0" cellpadding="0">
86 <tr valign="top" align="left">
87 <td width="10%"></td><td width="90%">
88 Forms are low-level entities. To do seriously interesting
89 things with forms such as self-validation, use one of the
90 higher-level form-type abstractions that monolith provides
91 (XXX will provide, not now - RWMJ).</td></table>
92
93 <table width="100%" border=0 rules="none" frame="void"
94        cols="2" cellspacing="0" cellpadding="0">
95 <tr valign="top" align="left">
96 <td width="10%"></td><td width="90%">
97 <b>new_ml_form</b> creates a new form widget.</td></table>
98
99 <table width="100%" border=0 rules="none" frame="void"
100        cols="2" cellspacing="0" cellpadding="0">
101 <tr valign="top" align="left">
102 <td width="10%"></td><td width="90%">
103 <b>ml_form_set_callback</b> sets the callback function which
104 is called when the form is submitted. The callback function
105 is invoked as <b>void callback_fn (ml_session session, void
106 *data)</b>. The values that the user entered in the input
107 fields are available by calling (for example)
108 <b>ml_form_input_get_value(3)</b> on each input widget
109 within the form.</td></table>
110
111 <table width="100%" border=0 rules="none" frame="void"
112        cols="2" cellspacing="0" cellpadding="0">
113 <tr valign="top" align="left">
114 <td width="10%"></td><td width="90%">
115 <b>ml_form_pack</b> packs a widget into the form. A form can
116 only store a single widget, so if you call pack subsequent
117 times, the earlier widgets are forgotten.</td></table>
118 <a name="AUTHOR"></a>
119 <h2>AUTHOR</h2>
120
121 <table width="100%" border=0 rules="none" frame="void"
122        cols="2" cellspacing="0" cellpadding="0">
123 <tr valign="top" align="left">
124 <td width="10%"></td><td width="90%">
125 Richard Jones &lt;rich@annexia.org&gt;</td></table>
126 <a name="LICENSE"></a>
127 <h2>LICENSE</h2>
128
129 <table width="100%" border=0 rules="none" frame="void"
130        cols="2" cellspacing="0" cellpadding="0">
131 <tr valign="top" align="left">
132 <td width="10%"></td><td width="90%">
133 GNU LGPL (see http://www.gnu.org/)</td></table>
134 <a name="VERSION"></a>
135 <h2>VERSION</h2>
136
137 <table width="100%" border=0 rules="none" frame="void"
138        cols="2" cellspacing="0" cellpadding="0">
139 <tr valign="top" align="left">
140 <td width="10%"></td><td width="90%">
141 monolith-1.0.0</td></table>
142 <a name="SEE ALSO"></a>
143 <h2>SEE ALSO</h2>
144
145 <table width="100%" border=0 rules="none" frame="void"
146        cols="2" cellspacing="0" cellpadding="0">
147 <tr valign="top" align="left">
148 <td width="10%"></td><td width="90%">
149 <b>new_ml_form_input(3)</b>, <b>new_ml_form_textarea(3)</b>,
150 <b>new_ml_form_submit(3)</b>.</td></table>
151 <hr>
152 </body>
153 </html>