My controller default.py:
def searchbar:
form = SQLFORM(....)
return (form=form)
On Monday, January 27, 2014 12:03:37 AM UTC-5, Apple Mason wrote:
>
> I have a search bar that I want to display on every page, but something is
> not working. Here is an example of what I have:
>
> layout.html:
>
> <html>
> <body>
>
> <div class="searchbar">
> {{include 'default/searchbar.html'}}
> </div>
>
> <div class="main"></div>
> </body>
> </html>
>
>
>
> In default/searchbar.html:
>
> {{=form}}
>
>
>
> But web2py doesn't find the searchbar controller function. I get an error:
>
> "NameError: name 'form' is not defined"
>
>
>
> because searchbar.html can't find {{=form}}.
>
> There have been some threads that use javascript for this, but I don't
> want to use that. Is there a pure html solution for this?
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.