Hi,
I'm trying to render a form using templates, and it is escaping all form
tags.
Code:
import web
from web import form
urls = (
'/', 'index'
)
nancy_form = form.Form(
form.Textarea('answer'),
)
class index:
def GET(self):
input = web.input(sentence=None)
render = web.template.render('templates/')
question = "Hello"
form = nancy_form()
return render.nancy(question, form)
if __name__ == "__main__":
app = web.application(urls, globals())
app.run()
nancy.py
$def with (question, form)
$if question:
Question: $question
<form name="main" method="POST">
$:form.render()
<input type="submit"/>
</form>
Page source:
<html>
<head></head>
<body>
<pre> Question: Hello <form name="main" method="POST"> <table>
<tr><th><label
for="answer">answer</label></th><td><textarea
id="answer" name="answer"></textarea></td></tr>
</table> <input type="submit"/> </form> </pre>
</body>
</html>
Thanks for the help.
-Aaron
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/webpy/-/ppXxvBLJXX0J.
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.