Jump to content


Photo

Drop-Down Menu with 'Include' files.


  • Please log in to reply
2 replies to this topic

#1 Fooleeze

Fooleeze
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 01 June 2006 - 07:49 PM

First off, I suppose I'm technically still a beginner at PHP, and I'm also brand new to this forum. I created a site, and now I'm working on version 2. Version 1 used frames, with drop-down menus on the left to search my database of products. For example, a "Color" menu with choices of "All Colors, Red, Black, Green, White." (where "All Colors" is the default). When using frames, you could select one of these colors, hit submit, and the products would show up on the right based on your selection. The drop-down menu would still show the selection that you made (because this frame didn't reload or refresh, only the target frame refreshed). Worked fine, but I've been instructed to use 'include' files instead of frames, so I'm working on V2 now.

Using 'include' files, the file that houses the drop-down menu now gets reloaded / refreshed each time I hit submit. So if I select "green" and hit submit, the table shows me the "green" items, but the drop-down menu is now reset to the default "All Colors." How do I get this drop-down menu to recognize what was selected and submitted, and show that in the drop-down when it is reloaded? My best example (not a website, but the same concept) would be in MS Word or MS Excel, when you use the 'drop-down' box to select a new font. When you select the font, the font you selected shows in the window until you change it.

Hopefully my long-winded question makes sense, and I hope someone here can point me in the right direction. Thanks for your time.

Todd

#2 Caesar

Caesar
  • Members
  • PipPipPip
  • Advanced Member
  • 1,025 posts

Posted 01 June 2006 - 07:56 PM

How are you populating your dropdowns? If the dropdown is being populated by options stored in a database, and you have a while loop going...this would be easy. PM me and I may be able to help you.
PHP Ninja

#3 Fooleeze

Fooleeze
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 01 June 2006 - 08:01 PM

The drop-downs are static html, not being populated from the database. But that could be done if it would be easier. It is a php file, and could access the database to create that drop down.

But right now, I just put it in manually.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users