cgi form handler question
Peter Hansen
peter at engcorp.com
Mon Apr 7 23:04:56 EDT 2003
jmdeschamps wrote:
>
> Peter Hansen <peter at engcorp.com> wrote in message news:<3E9158CA.C53791E5 at engcorp.com>...
> > Ian Bicking wrote:
> > > for name in form.keys():
> > > if not form[name].value:
> > > print name
> >
> > The latter suggestion won't usually work, as the data sent
> > from the browser does not even contain the names of the fields
> > which are left empty.
>
> ...left empty, -unless you use the form
> cgi.FieldStorage(keep_blank_values = 1) to get your form info as in
> http://www.python.org/doc/current/lib/node297.html
>
> and as someone else might have said, 'Happy CGI-ing',
D'oh! Did I get caught by assuming the behaviour I'd observed
using cgi.FieldStorage() recently was actually caused by the
browser instead of by cgi.py itself? Dang... sorry to mislead.
-Peter
More information about the Python-list
mailing list