var, var_qs, var_post — get the value of a form variable.
The var command retrieves information about GET or POST variables sent to the script via client request. It treats both GET and POST variables the same, regardless of their origin. Note that there are two additional forms of ::rivet::var: rivet::var_qs and ::rivet::var_post. These two restrict the retrieval of information to parameters arriving via the querystring (?foo=bar&bee=bop) or POSTing, respectively.
varname
? ??default?
?varname
as a string (even if there are multiple values). If
the variable doesn't exist as a GET or POST
variable, the
?default?
value is returned, otherwise "" - an empty string -
is returned.
varname
?varname
as a list,
one list element per reference. Radiobuttons or multiple
selection listboxes are suited widgets which may
return list data.
set response(countries) [::rivet::var list countries] set response(__countries) "" form form_request -defaults response form_request select countries -multiple 1 -values {USA Canada Mexico} form_request end
varname
?varname
exists, 0 if it doesn't.