With the form class, you either need to call it with the dictionary --
in your case:
f = self.searchForm(web.input())
Or, you need to a validation on it:
f = self.searchForm()
if not f.validates(): # The validation function populates the form
here
raise web.seeother('/')
Hope that helps,
Justin
On May 22, 2:45 am, ztl2004 <[email protected]> wrote:
> i follow the tutorial and i did generate my searchForm and a submit
> button.
> when i tried to post the fields, i looked into firebug and it told me
> i did post the data
> but when i tried to
> f = self.searchForm()
> print f.d
> all the field is none
>
> then i change to web.input()
> f = web.input()
> print f['somefield']
> the value exist
> what is the problem?
>
> thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "web.py" 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
> athttp://groups.google.com/group/webpy?hl=en.
--
You received this message because you are subscribed to the Google Groups
"web.py" 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/webpy?hl=en.