#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    64
    Rep Power
    2

    Getting started with category selection


    I've been working on a project for a while now that will be a large random image site where users can go to view or upload images. One image is displayed at a time, and clicking through pulls the next random image from the database.

    All the images have one of 8 predefined categories. I'm going to add a select input that will allow the user to choose a certain category of images to be displayed.

    I was planning on setting the selected category to a session variable, and just include the category in the SQL query.

    What I'm not sure about is how to achieve a select input that will submit on its own when a selection is made, and how to keep that selection displayed from page to page?

    Any help or suggestions of a better method is greatly appreciated.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,405
    Rep Power
    594
    Do you mean when the user selects the category, it will immediately submit the form to display the image? If so you can do the submit with Javascript.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    64
    Rep Power
    2
    Originally Posted by gw1500se
    Do you mean when the user selects the category, it will immediately submit the form to display the image? If so you can do the submit with Javascript.
    That's exactly what I meant, I'll go that route. Thanks for pointing me in the right direction.
  6. #4
  7. Put a potato on it!
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2008
    Location
    Maryland
    Posts
    304
    Rep Power
    971
    As for having it stay that way, page to page, a session variable would take care of that.
    "Those who can make you believe absurdities can make you commit atrocities."

IMN logo majestic logo threadwatch logo seochat tools logo