Re: multiple input fields validation

"Matthew Wilson" <[email protected]> Tue, 30 Dec 2008 09:06:59 -0500
Newsgroups gmane.comp.python.formencode
Message-ID <[email protected]>
On Tue, Dec 30, 2008 at 8:27 AM, Marcin StÄ™pnicki <[email protected]> wrote:

snip

> <input id="finish_date-1" type="text" value="" style="width: 80px;"
> name="finish_date"/>
> <input id="finish_date-2" type="text" value="" style="width: 80px;"
> name="finish_date"/>
> etc.

Since you have two input elements with the same name, your form will
submit data like:

finish_date=value1&finish_date=value2

So you can parse that with formencode.foreach.ForEach.   Are you
really sure you want all the text fields to have the same name?

Also consider using a schema-level validator that works on the whole
dictionary of values, rather than each value separately.

Matt

-- 
Matthew Wilson
[email protected]
http://tplus1.com
------------------------------------------------------------------------------