Hello, I encounter a problem with the forms:
is my code correct? I can not recover the values sent for each form :
My test.py:
import web
from web import form
urls = ('/', 'Page')
app = web.application(urls, globals())
render = web.template.render('')
class Page:
""" """
form_na = form.Form(
form.Textbox('name', size=30, description="Name:"),
form.Textbox('prename', size=30, description="Prename:"),
form.Button('Send 1') )
form_ip = form.Form(form.Textbox('ip', size=45, description="IP :"),
form.Button('Send 2') )
def GET(self):
""" """
form1 = self.form_na()
form2 = self.form_ip()
return render.Page(form1, form2)
def POST(self):
""" """
form1 = self.form_na()
form2 = self.form_ip()
return "Results form1: %s %s\nResults form2 : %s" %
(form1.d.name, form1.d.prename, form2.d.ip)
if __name__ == "__main__":
app.run()
My Page.html:
$def with (form1, form2)
$if form1:
<form action="" method="post">
$:form1.render()
</form>
$if form2:
<form action="" method="post">
$:form2.render()
</form>
Thanks for your help !
--
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.