[Zope] HTML Form processing

Jim Washington jwashin@vt.edu
Thu, 04 Apr 2002 21:45:47 -0500


Colin Fox wrote:

>Hi all.
>
>I'm doing a bunch of HTML form processing, and part of that is allowing
>the user to select a number of elements from a multi-select list.
>
>If the user selects 2 or more items, I get a python list back, which is
>great. I can use a <dtml-in ...> to process it.
>
>The problem is, if only one item is selected, I *don't* get a list, and
>my <dtml-in ...> barfs, complaining that I can't pass it a string.
>
>Is there any way I can FORCE the value to be a list, even if there's
>only one element? Or maybe make dtml just "shut up and do it", or do I
>have to have some kind of hacky dtml? Or do I have to abandon dtml for
>this and go for a script?
>
Relax.  There is a way.  Append ":list" to the name attribute of the 
form element.

e.g.,

<select name="myList:list">

-- Jim Washington