On 08/02/2012 12:29 PM, Niphlod wrote:
formname='something' serializes within the form a hidden input, so
web2py can distinguish what form is being submitted. If the submitted
values were to be serialized as urlencoded, just to explain, for the
first form would be
name=value&formname=form_one
and for the second
name=value&formname=form_two
Ok, I'm starting to understand. So looking at the manual
exceprt:
def two_forms():
form1 = FORM(INPUT(_name='name', requires=IS_NOT_EMPTY()),
INPUT(_type='submit'))
form2 = FORM(INPUT(_name='name', requires=IS_NOT_EMPTY()),
INPUT(_type='submit'))
if form1.process(formname='form_one').accepted:
response.flash = 'form one accepted'
if form2.process(formname='form_two').accepted:
response.flash = 'form two accepted'
return dict(form1=form1, form2=form2)
I would have to assume that the hiddens are only generated
because of the call to FORM.accepted(). Should I assume then
that the 'formname' keyword is only necessary when there is
more than one form in the page?
Thanks,
Toby
--