Reputation: 99
I'm trying to get value from user using form and send the value to another controller to do some operation on it
Simple Example : how to send x from (default/index.html) to (output/index.html) or how to call the function (output/index) in (default/index.html)
default.py
index():
return dict()
index.html
{{extend 'layout.html'}}
<form enctype="multipart/form-data" action="{{=URL()}}" method="post">
Your name: <input name="name" /> <input type="submit" />
</form>
{{x=request.vars.name}}
output.py
index(x):
return x
Upvotes: 1
Views: 1790
Reputation: 25536
Just post the form to the URL that you want to handle the data:
<form enctype="multipart/form-data" action="{{=URL('output', 'index')}}" method="post">
Upvotes: 2