[web2py] Re: Iterate through form input

2010-02-26 Thread minh
I have something like this: form = FORM('Emails:', BR(), INPUT(_name='email', requires=IS_NULL_OR(IS_EMAIL())), BR(), INPUT(_name='email', requires=IS_NULL_OR(IS_EMAIL())), BR(), INPUT(_name='email', requires=IS_NULL_OR(IS_EMAIL()

[web2py] Re: Iterate through form input

2010-02-26 Thread minh
I forgot to mention, the form loads fine... I get the error on submit. On Feb 26, 1:58 pm, minh wrote: > I have something like this: > >         form = FORM('Emails:', BR(), >                     INPUT(_name='email', > requires=IS_NULL_OR(IS_EMAIL())), BR(), >                     INPUT(_name='ema

[web2py] Re: Iterate through form input

2010-02-27 Thread mr.freeze
Try this. It builds the form dynamically on the client and server so you get to keep the benefits of SQLFORM (validation, etc): def invite(): fields = [Field('email',requires=IS_EMAIL())] for r in range(1, len(request.vars)): if 'email%s' % str(r) in request.vars.keys():

[web2py] Re: Iterate through form input

2010-02-28 Thread mr.freeze
Whoops, that's response.flash :) On Feb 28, 12:39 am, "mr.freeze" wrote: > Try this. It builds the form dynamically on the client and server so > you get to keep the benefits of SQLFORM (validation, etc): > > def invite(): >     fields = [Field('email',requires=IS_EMAIL())] >     for r in range(1

Re: [web2py] Re: Iterate through form input

2010-02-26 Thread Thadeus Burgess
Unfortunately you will not be able to "add" fields when using FORM. You will have to iterate over the request.vars manually. -Thadeus On Fri, Feb 26, 2010 at 3:59 PM, minh wrote: > I forgot to mention, the form loads fine... I get the error on submit. > > On Feb 26, 1:58 pm, minh wrote: >>

Re: [web2py] Re: Iterate through form input

2010-02-27 Thread Yarko Tymciurak
You can accomplish this with a text field - you then parse the input. You can see a (somewhat messy - as it evolved incrementally over several manual efforts - and really needs some refactoring into smaller functions) - in the batch registration processing for PyCon 2010: I wanted to take a list