.ig >>
<STYLE TYPE="text/css">
<!--
        A:link{text-decoration:none}
        A:visited{text-decoration:none}
        A:active{text-decoration:none}
        OL,UL,P,BODY,TD,TR,TH,FORM { font-family: arial,helvetica,sans-serif;; font-size:small; color: #333333; }

        H1 { font-size: x-large; font-family: arial,helvetica,sans-serif; }
        H2 { font-size: large; font-family: arial,helvetica,sans-serif; }
        H3 { font-size: medium; font-family: arial,helvetica,sans-serif; }
        H4 { font-size: small; font-family: arial,helvetica,sans-serif; }
-->
</STYLE>
<title>quisp: big lists of checkboxes (etc.)</title>
<body bgcolor=99cc99 vlink=0000FF>
<br>
<br>
<center>
<table cellpadding=2 bgcolor=FFFFFF width=550 ><tr>
<td align=right><a href="quisp_home.html">
<img src="img/quisp2.gif" border=0><br><small>quick server pages</a> &nbsp; &nbsp; </td></tr>
<td>
.>>

.TH big lists of checkboxes (etc.) TDH "13-APR-2004   TDH scg@jax.org" 

.SH Handling big lists of checkboxes (etc.)
How can an 
.ig >>
<a href="forms.html">
.>>
\0HTML form
.ig >>
</a>
.>>
get a user's choice from a large list of possibilities?
SELECT option lists are one possibility, however they suffer from limitations
such as poor readability, lack of formatting, and clumsiness when the list gets long.
A big set of RADIO buttons might work, but then we're limited to single choice.
What if we need multiple choice?  Or, what if we want the user to select "high", "low", or "normal"
for selected items?
HTML forms provide on/off checkboxes, but these are one per item, and using the 
QUISP methods shown thus far we would have to enumerate all the
checkbox names in the 
.ig >>
<a href="forms.html">
.>>
\0target page
.ig >>
</a>
.>>
in order to capture or process the result.
.LP
QUISP solves this problem with the \fC#allresponses\fR directive.
The \fBform page\fR should contain a list of response items (in the simplest
case these are checkboxes but they can also be \fCSELECT\fRs or \fCRADIO\fR buttons).
On the \fBtarget page\fR, \fC#allresponses\fR may be used to gather all of
the checkboxes that have some value (default is \fCon\fR), and build a 
.ig >>
<a href="commalist.html">
.>>
\0comma-delimited list
.ig >>
</a>
.>>
of those response field names.  This list can then be stored in the database, etc.

.ig >>
<br><br><br>
.>>
.SH Examples
See the
.ig >>
<a href="http://quisp.sourceforge.net/cgi-bin/quisp?rtn=index">
.>>
\0live demo on sourceforge.
.ig >>
</a>
.>>

.ig >>
<br><br><br>
.>>
.SH #allresponses
On a form
.ig >>
<a href="forms.html">
.>>
\0target page,
.ig >>
</a>
.>>
gather incoming user variables that have a certain value (default is \fCon\fR), and build a 
.ig >>
<a href="commalist.html">
.>>
\0comma-delimited list
.ig >>
</a>
.>>
of those variable names.
.LP
Usage: \fC#allresponses  \fIresultvarname\fC  [\fInamepat  valuepat\fC]
.LP
\fBresultvarname\fR is the name of the QUISP variable where the comma-delimited
list of response field names will be placed.
.LP
\fBnamepat\fR specifies a wildcard pattern that checkbox names must match
in order to qualify for the gathering.  Use \fC*\fR to match everything.
For instance, a \fInamepat\fR of \fCab_*\fR
would include checkboxes named \fCab_1\fR and \fCab_28\fR, but not \fCbc_12\fR.
.LP
\fBvaluepat\fR specifies a wildcard pattern that submitted form values
must match in order to be gathered into the list.  Use \fCon\fR to match
simple checkboxes that are checked.
.LP
If \fCnamepat\fR and \fCvaluepat\fR are omitted, the default is that all response fields
having the value \fCon\fR will be gathered.
Note that use of \fCnamepat\fR and \fCvaluepat\fR allows multiple \fC#allresponses\fR 
to be used in the same target page.  


.ig >>
<br>
<br>
</td></tr>
<td align=right>
<a href="quisp_home.html">
<img src="img/quisp2.gif" border=0></a><br>
<small>quick server pages &nbsp; &nbsp;<br>
<a href="Copyright.html">Copyright Steve Grubb</a> &nbsp; &nbsp;
</td></tr>
</table>
.>>
