What does your controller look like?

-Jim

On Monday, February 8, 2016 at 8:35:41 PM UTC-6, superpirst wrote:
>
> I created a website that you could post items and I'm having a lot of 
> problem trying to figure out how to make a dropdown menu that can filter 
> those posts. What I'm trying to do is that when you make a post, you can 
> only pick from the 4 categories. Then in the main page, you will have a 
> drop down box where you can select one of those keywords and it will filter 
> out all the posts so that only the posts with that select keyword will 
> show. 
>
> In my db.py I made
>
> post_categories= ['Food', 'Games, 'Hobbies', 'Toys']
>
> db.define_table('posts',
>                 Field('title', requires=IS_NOT_EMPTY()),
>                 Field('price'),
>                 Field('category', requires=IS_IN_SET(post_categories)),
>                auth.signature)
>
>
> In my view index.html
>
> I have 
>
> <select id="post_categories">
>            <option value='0'>(Select Category)</option>
>         </select>
> I was wondering why on my page, the 4 keywords aren't showing up in the 
> drop down box? 
>
> Also, I heard you can use a form tag(not sure how to work this) to sent 
> the data to another view ("filterCategory"). 
> I'm not sure how to even get this to work. I spent almost a week looking 
> up solutions, but got no where...
>
> Any help will be great!!
> Thank you
>
>  
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to