Robert Kern wrote:
> Diez B.Roggisch wrote:
> >>Traceback (most recent call last):
> >> File "/var/www/users/senta/html/gobooks/cgi/form.py", line 35, in ?
> >>if not form.keys()[key]:
> >>TypeError: list indices must be integers
> >>
> >>As you can see, I am using python 2.3 (my web service
Diez B.Roggisch wrote:
>>Traceback (most recent call last):
>> File "/var/www/users/senta/html/gobooks/cgi/form.py", line 35, in ?
>>if not form.keys()[key]:
>>TypeError: list indices must be integers
>>
>>As you can see, I am using python 2.3 (my web service provider is
>>responsible for thi
> Traceback (most recent call last):
> File "/var/www/users/senta/html/gobooks/cgi/form.py", line 35, in ?
> if not form.keys()[key]:
> TypeError: list indices must be integers
>
> As you can see, I am using python 2.3 (my web service provider is
> responsible for this - I'd use 2.4.1 if I
googleboy wrote:
> for key in form.keys():Yes, I know which fields are hidden because I
> made them that way, but I am trying to figure out a way I can iterate
> over the fields and do one thing with hidden fields (assign them to
> variables that tell the form how to process) and a different th
for key in form.keys():Yes, I know which fields are hidden because I
made them that way, but I am trying to figure out a way I can iterate
over the fields and do one thing with hidden fields (assign them to
variables that tell the form how to process) and a different thing with
non hidden fields
> The second for loop is an attempt at trying to print all the values
> that were entered on the for without presenting the hidden values. I'd
> really like to do this, but I can't seem to figure out how to make a
> special case for hidden form values, nor can I find an example of how
> to do it i
"Atila Olah" <[EMAIL PROTECTED]> writes:
> for key in form.keys():
> if not form.keys()[key]: # True if it's a value is None
Ugh! I think you mean
for key, value in form.items():
if not value:
These days you can also say iteritems instead of items and avoid
building a potentially
>for key in form.keys():
>if not form.has_key(key): # it will always be True
try this:
for key in form.keys():
if not form.keys()[key]: # True if it's a value is None
Well, I don't exactly know the methods of the CGI module, but there are
ways to access form data in Apache's mod_python m
Hi there.
I am having a bit of a play with teh cgi module, trying to figure out
how to process a web form.
I have come a little ways from reading up variou sexamples and tutes
that I've found on the net, but they all leave me with a couple of
questions:
My code below has an attempt at validation