First you can use javascript validation for front end. For back end use
webpy form validation:
myForm = form.Form(
form.Textbox("keyword",
form.notnull,
description=net.websafe("Search"),
),
)
In main class:
frm = myForm()
if not frm.validates():
#do what ever you want
2011/7/20 Troels Mæhl Folke <[email protected]>
> Hi! I'm sorry if this question is pretty basic.
> I have a form, which data are used to make a database query. As there
> always has to be at least one search criteria in the query, one form
> field (it doesn't matter which one) always has to be filled. In other
> words I will have to check the form for being empty. I just don't know
> how I would accomplish this in a good way.
> I would appreciate if anyone could help me or give me a hint.
>
> --
> 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.
>
>
--
Aydın Ş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.