Gossamer Forum
Home : Products : DBMan : Discussions :

0 (zero) returns "No search terms specified"

Quote Reply
0 (zero) returns "No search terms specified"
 
Hi all,

I want my users to be able to search on certain fields that contain 0 (the number zero). But they get "search term not specified" eror message. Any way around this?

Thanks.

Quote Reply
Re: [RogerSolo] 0 (zero) returns "No search terms specified" In reply to
0 is interpreted as NULL or undefined so the script will think nothing is entered.

In sub query try changing:

# If we don't have anything to search on, let's complain.
if (!@search_fields and !@search_gt_fields and !@search_lt_fields) {
return "no search terms specified";
}

to:

# If we don't have anything to search on, let's complain.
if (!@search_fields and !@search_gt_fields and !@search_lt_fields and grep { !/0/ } @search_fields) {
return "no search terms specified";
}

I don't know if it will work though.

Last edited by:

RedRum: Nov 13, 2001, 6:07 AM
Quote Reply
Re: [RedRum] 0 (zero) returns "No search terms specified" In reply to
Unsure

Now, if someone searches for a 0, it will also report fields that contain other number, example, 3000. I have the ww (whole word) set.

Last edited by:

RogerSolo: Nov 13, 2001, 8:56 PM
Quote Reply
Re: [RedRum] 0 (zero) returns "No search terms specified" In reply to
and it also reports any records that have NO values set. Its now taking empty fields az zeros. :-(