virhilo
unread,Apr 12, 2009, 6:03:29 PM4/12/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py Web Framework
Hello:)
I want to send a form using get method, so i make form like this:
form=FORM('Package name: ',
INPUT(_name='name', requires=IS_LENGTH(25), value=''),
'Arch: ',
SELECT(OPTION('Wszystkie', _value='all'),
OPTION('i686', _value='32'),
OPTION('x86_64', _value='64'),
requires=IS_IN_SET(['all', '64', '32']),
value='all',
_name='arch'),
INPUT(_type='submit', _value='Search...'),
_method='get',
_action=None)
form.accepts(request.vars)
Everythink working fine, but web2py adding _formname to
request.get_vars, it make urls less reradable.
Turicas from #web2py irc channel helps me to find solution, when
formname='' was added to form.accepts args (so it's now look like
that: form.accepts(request.vars, formname='') ) but then the form
validation don't working,
so another solution is setting formname to None ( form.accepts
(request.vars, formname=None) ), but then the value fields from SELECT
and INPUT are not parsed, form return error 'Value not allowed'
The web2py default's is to send formname as a hidden field _formname.
i think it is unnecessary. The only modification here is that if user
submit a form without fill any field, form won't show errors.
Version 1.60.5 (2009-04-12 11:21:07)