Gossamer Forum
Home : Products : DBMan : Installation :

search multiples fields

Quote Reply
search multiples fields
Hi It is posible to search whith two or three options for example I have this fields
Country
Region
Activities

and I want to search about Argentina(Country)and Snorkeling(Activitie)

It is posibble? How I can write this option? separate whith comma?

Can you help me?
Thanks.
I did a mistake and I write a private message, sorry.
Thanks.

Quote Reply
Re: search multiples fields In reply to
On the regular "View" form, just fill in the fields you want to search on with the values you want to search for. The script will do the rest.


Quote Reply
Re: search multiples fields In reply to
Thanks.
I have another one.
I trie to explain you.
It is possible , for example when I add a mew charge to the dbman in one field that I have two options, one whith drop down menu and two free.
For example if I have COUNTRY: one, whith drop down menu I have 6 options and if I didnīt find what I want to add, in other option I will can add different country.

It is possible?
Sorry about my Inglish.

Quote Reply
Re: search multiples fields In reply to
You could have two field for County and name them County and County1, but that might make it difficult when you do searches as people would have to search in two different fields.

You might want to consider listing all the possible countries in your "Country" field and have your users select the country. Same with your activities field.

There was a recent thread which contained several different country lists, each with a little variation.

Having the selections all within one field will make it much easier to search in the long run.

Hope this helps :)

Quote Reply
Re: search multiples fields In reply to
Yes, it is possible to do what you want.

In the place where you want the drop-down list to appear on your form, use

Code:

|;
print &build_select_field_from_db("FieldName",$rec{'FieldName'});
print "<BR>|;
unless ($in{'view_search'} or $in{'delete_search'} or $in{'modify_search'}) {
print qq|
<input type="text" name="FieldName" value="$in{'FieldName'}" size=20>
|;
}
print qq|</td></tr>
Notice that in the text field I have the value as $in{'FieldName'}. This is how it needs to be. Be sure to change FieldName to match the name of the field from your .cfg file.

In the db.cgi file, sub parse_form, after

if ($value eq "---") { next PAIR; }

add

unless ($value) { next PAIR; }


JPD
Quote Reply
Re: search multiples fields In reply to
OK! I have this in the default.cfg Activitie => [0, 'alpha', 40, 150, 1, '', ''],
Region => [1, 'alpha', 40, 150, 1, '', ''],
Country => [2, 'alpha', 40, 150, 1, '', ''],
Title => [3, 'alpha', 40, 255, 1, '', ''],
URL => [4, 'alpha', 40, 255, 1, 'http://', '^http://'],
Description => [5, 'alpha', '40x3', 500, 0, '', ''],
Email => [6, 'alpha', 40, 170, 1, '', ''],


I want for example that the field Country can have two options one free, and second with drop down menu
Where I must to replace exactly whith your text?
Now you can see that Country has an option free I wantto add a option whith drop down menu and the two options can function at the same time.

Thanks.



Quote Reply
Re: search multiples fields In reply to
You would put the following into sub html_record_form.

Code:

|;
print &build_select_field_from_db("Country",$rec{'Country'});
print "<BR>|;
unless ($in{'view_search'} or $in{'delete_search'} or $in{'modify_search'}) {
print qq|
<input type="text" name="Country" value="$in{'Country'}" size=20>
|;
}
print qq|</td></tr>
I can't tell you exactly where to put it, because I don't know what is already there.

Oh, you can't use this with the autogenerate feature. You must create your own sub html_record_form.

JPD
Quote Reply
Re: search multiples fields In reply to
Where I must replace
in db.cgi in sub build_html_record_form
or in default.cfg in sub build_html_record {

in Database Definition I must replace something?

Thanks.

Quote Reply
Re: search multiples fields In reply to
This is not in the db.cgi file. You must replace the code in html.pl, sub html_record_form.

You don't need to do anything in the .cfg file.


JPD