Gossamer Forum
Home : Products : DBMan : Customization :

I don't remember anyone doing this...

Quote Reply
I don't remember anyone doing this...
On a search page, can you have a drop down search box populated with everything in a given field of your data base? Example: car dealership....people can use a drop down menu to select gmc,ford,vw.....but only if those items are showing in the data base......also....each vehicle type would only appear once on the drop down....a search on ford would bring up all fords....

Has it been done?

Any thoughts? Anyone? (and you know who I'm looking at)
Quote Reply
I stand corrected In reply to
>>>>> I found this:



You can have the script pull the values from the database. Instead of

print &build_select_field("FieldName",$rec{'FieldName'})

use

print &build_select_field_from_db("FieldName",$rec{'FieldName'})

JPD
http://www.jpdeni.com/dbman/



>>>>> And now I guess I'll have to try and instal it.....is it really as easy as above? Will it only show one instance of every entry even if there are multiple entries? I guess I'll know in a day or two

steven99
Quote Reply
Re: [steven99] I stand corrected In reply to
I have used that sort of thing before, and yes it removes dulicates, and sorts the select list.

Normally this is used to fill in the form, but you should be able to use it for a search form as well.

Looking at the sub in db.cgi, it appears that you need a third parameter, and that would be the name of the column in the db that you want the sub to pull the values from.

print &build_select_field_from_db("FieldName",$rec{'FieldName'},"Fieldname")

Otherwise I would consider installing the categories MOD complete with a count, then the user is presented with a list of "car makes" and how many are available, and a link. This saves the user a search step.