cgi getlist() problem (my first python program)

Gobo Borz goboborz at yahoo.com
Thu Jun 19 10:59:12 EDT 2003


Hi,

This is my first Python program, and I'm having problems with  cgi 
getlist() skipping values in a multi-row html form.

I have a typical multi-row html form with fields like "name", "phone", 
"department", etc.  The "phone" field is named "phone" in every row, the 
name field is named "name" in every row, etc.  When I use getlist() to 
get the field values, it skips empty fields. Thus, phone[4], for 
example, may  turn out to be in a different row than name[4], depending 
on which fields the user has left blank.

Even if I force a space in the field with javascript on the client side, 
the python FOR loop skips the blank values.  But that wouldn't be a very 
pretty solution anyway.

I hope I'm not missing something obvious. It seems like this would be a 
common problem for anyone coding a multi-row html form.

Thanks for your help,

Gobo

P.S. Sorry, if this appears twice.  I posted through Google about 16 
hours ago, but I'm posting again because I don't see it.





More information about the Python-list mailing list