Gossamer Forum
Home : Products : DBMan : Customization :

dynamic dropdown menu

Quote Reply
dynamic dropdown menu
I would like to create an external search form that has one dropdown menu and an entry field for keywords so that the user can search under a specific category as the search criteria.

For example:

=============================

Category: (dynamic list from db)
Keyword(s): (-----------------)

|SUBMIT| |RESET|

=============================

Is there a way to do this dynamically so that the dropdown reads a datafield and updates per the database?

Thanks in advance!

Cher
Quote Reply
Re: dynamic dropdown menu In reply to
You can use the &build_select_field_from_db routine which builds a list of options based on the values in your database.

For example, the following will produce a dropdown of all the values stored in your "Category" field:
print &build_select_field_from_db('Category', $in{'Category'}, 'Category');

Note that you will need to temporarily stop any print qq codes you may have started when you include this.

- Mark


Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: dynamic dropdown menu In reply to
I know that I can do that when I create an internal form (via altering the html.pl) but what I want is to create an external form with this feature included. Does this apply to that type of programming also?



Cher
Quote Reply
Re: dynamic dropdown menu In reply to
Check out this mod which was written to be able to use fields within a database in an external search form:

Subject SSI - autogenerated dropdown solution
MAGSGQ 3-Feb-01 07:05 PM
Thread reference: http://gossamer-threads.com/p/125394

Hope this helps

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: dynamic dropdown menu In reply to
Thank you so much! You are the best!

Cher