[mod_python] Accessing all form fields, empty strings or not

Diener, Edward Edward.Diener at loyaltyworks.com
Fri May 21 14:34:57 EDT 2004


> -----Original Message-----
> From: Michael S. Fischer [mailto:michael at dynamine.net] 
> Sent: Friday, May 21, 2004 1:31 PM
> To: Diener, Edward
> Cc: mod_python at modpython.org
> Subject: RE: [mod_python] Accessing all form fields, empty 
> strings or not
> 
> 
> Edward Diener writes:
> 
> > That is very strange because when I check the keys for my form (
> > form.keys() ), the checkbox field only exists in the list of
> > keys when the checkbox is checked but doesn't exist 
> > otherwise. But I do see the code mentioned above in psp.py. 
> > Is there any other way to find out if a field exists in a 
> > form irregardless whether its value is blank or not ?
> 
> You didn't mention that it was a checkbox field before.
> 
> Checkbox fields are a special case; many browsers do not 
> include unchecked checkbox fields when submitting a form to 
> the server (MSIE 6 included). Therefore, it should not be 
> unsurprising that such empty fields are not in the list of form keys.
> 
> There's nothing you can do about this other than to recognize 
> the situation and code around it.

OK, now I understand. I will have to add appropriate hidden fields with
values to deal with the problem. Thanks !



More information about the Mod_python mailing list