Hi voltron,

I wrote a blog entry about this here:
http://jimmyg.org/2007/09/19/multiple-checkboxes-with-formencode/

Basically you use a custom Schema in a ForEach validator and then use a 
NestedVarables pre-validator to decode the data to a list. You then need 
to re-encode it before using HTMLfill to re-populate your form. Your 
form template needs to name the variables in the correct style so that 
FormEncode can decode them correctly.

The blog entry starts off talking about checkboxes but the bit you need 
is slightly further down. I'm writing a chapter for the Pylons book 
about this at the moment so if you need more info let me know and I'll 
send you the draft off-list.

Cheers,

James

voltron wrote:
> Checking up the docs, I really, really would how this works, it would
> be "magic". variable_decode, according to the docs, would take a list
> char for decoding into lists, the default is list_char='-', How would
> that work in my case? I could use a code snippet.
> 
> Thanks!
> 
> On Sep 25, 12:28 pm, Clemens Hermann <[EMAIL PROTECTED]> wrote:
>> On Sep 25, 12:15 pm, voltron <[EMAIL PROTECTED]> wrote:
>>
>>> I have asked about something like this before, this is similar but
>>> more complicated:
>> I have answered about something like this before, this is similar and
>> the solution is the same :)
>>
>>> academic_from_year0, academic_till_year0  e.t.c
>>> academic_from_year1, academic_till_year1 e.t.c
>>> academic_from_year2, academic_till_year2 e.t.c
>> http://formencode.org/module-formencode.variabledecode.html
>>
>> hth,
>>
>> /ch
> 
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to