On Saturday, 7 September 2013 20:50:32 UTC+10, kranthi aeronaut wrote:
>
> some please help me , i am using web2py for simple addition of 2 numbers 
> application , i have created a function called "calc" in default.py and 
> wrote the following code in it
>
> *def calc():*
> *    answer=request.vars.a+request.vars.b*
> *    return dict(answer)*
> *
> *
> i created a file called default/add.html & wrote following code in it:
> *
> *
> <html>
> <form action="calc" method="POST">
>         <input name="a" required/><br>
>         <input name="b" required/><br>
>         <input type="submit"/>
> </form>
> </html>
>
> again i created another file called default/calc.html & wrote the 
> following code:
>
> <html>
> <h1>{{=answer}}</h1>
> </html>
>
> now when i enter 2 numbers in text field & click submit ,   i am getting 
> lots of errors & unable to get the answer , is there anything wrong in code 
> , please help me ....
>
> Why don't you follow the examples in the book? (http://web2py.com/book) 
Start with the overview chapter. You are trying to submit data with a form. 
web2py handles this very easily, and it is all documented well in the book. 
The book will take you through several ways of doing this in web2py.
You should immediately follow the lead of the book (overview chapter under 
the heading "Say my name") which will show you how to get it working.



 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to