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)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---