cgi getlist() problems

Gobo goboborz at yahoo.com
Wed Jun 18 11:07:57 EDT 2003


Hi all,

I'm having a problem with my first Python program.

I'm coding an html/cgi form that uses rows to capture multiple
entries, for fields like "name", "phone", "department", etc.  I use
the same "name=" for every field in the same column.   For example,
the phone field is named "phone" in every row.

When I try to get the values with getlist(), empty values don't show
up in the list.  Because of this, for example,  name(4) and phone(4)
might be from different rows in the html form depending on what the
user left blank.  Even if I force a blank with javascript on the
client side, iterating through the list with a FOR statement still
ignores the blank values.

Is there any way to capture these field values such that the rows stay
in sync?  I may be missing something obvious, because It seems like
this would be a common problem for anyone coding a multi-row html
form.

Thanks, Gobo




More information about the Python-list mailing list