#set TITLE = "big lists of checkboxes (etc.)"
#include top

.SH Handling big lists of checkboxes (etc.)
How can an 
#set FILE = "forms.html"
#set TAG = "HTML form"
#include link
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 
#set FILE = "forms.html"
#set TAG = "target page"
#include link
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 
#set FILE = "commalist.html"
#set TAG = "comma-delimited list"
#include link
of those response field names.  This list can then be stored in the database, etc.

#include space
.SH Examples
See the
#set FILE = "http://quisp.sourceforge.net/cgi-bin/quisp?rtn=index"
#set TAG = "live demo on sourceforge."
#include link

#include space
.SH #allresponses
On a form
#set FILE = "forms.html"
#set TAG = "target page,"
#include link
gather incoming user variables that have a certain value (default is \fCon\fR), and build a 
#set FILE = "commalist.html"
#set TAG = "comma-delimited list"
#include link
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.  


#include bottom
