Gossamer Forum
Home : Products : DBMan : Customization :

drop-down fields

Quote Reply
drop-down fields
I would like to have a drop down menu listing fields, next to a input box for a word, so users could choose Author for the field, and then type in the box to the right for the authors name.

*example*

input option=Author

text box value=Twain

makes this search

db.cgi?db=default&uid=default&Author=Twain&view_records=View+Results

Quote Reply
Re: drop-down fields In reply to
I don't really understand your request. You want a drop-down menu of options for same field??? Please be more specific.

Regards,

Eliot Lee
Quote Reply
Re: drop-down fields In reply to
I would like the user to be able to choose which field to search from a drop down, and then type in a word(s) to search (from the chosen field) in a text box.

If an example will help, here is the interface I want at the top of this screen.

http://www.civilwarbookreview.com/

(author, reviewer, title, are different fields)

Quote Reply
Re: drop-down fields In reply to
If my reading of your post is correct, you want to search in the database for records relating to a particular author.
You may simply create a drop down box pre-populated with all the Author names for which you have records.
The trouble with this is that you will want to add or subtract author names.
An elegant solution to this is to have a separate Author.db that will populate the drop down box.
There is a mod that allows you to do this. Go to Search and look for the posting titled "Re: Selectable Fields" posted on 25-Jul-00 06:01 PM by JPDeni. It contained a sub-routine called build_select_field_from_other_db that builds a select field from an external database.



David Olley
Anglo & Foreign International Limited,
http://www.afil.co.uk
Quote Reply
Re: drop-down fields In reply to
No that isn't what I want. I don't want the drop-down box to contain what is in a particular field, I want it to contain the name of each field. So the user can chose, using the drop down box, what field to search, then type in the data to search for.

Thanks anyway.

Quote Reply
Re: drop-down fields In reply to
Now you've lost me.

All the user has to do is type his search parameters in the field which is already defined in your database search form.

I can't think what else you could mean.

David Olley
Anglo & Foreign International Limited,
http://www.afil.co.uk
Quote Reply
Re: drop-down fields In reply to
I have something like this in mine.

try including this in your html_search .
Code:
<SELECT name=fields1>
<OPTION selected>---</OPTION>
<OPTION value="Author">Author</OPTION>
<OPTION value="etc">etc</OPTION>
......
<INPUT TYPE="TEXT" NAME="value1" SIZE="30" MAXLENGTH="30">
then in your db.cgi in sub query after local (%sortby);

add
Code:
if ($in{'fields1'} && $in{'value1'}) {
$in{$in{'fields1'}} = $in{'value1'};
}
Trev

Quote Reply
Re: drop-down fields In reply to
Thank you!!