Gossamer Forum
Home : Products : DBMan : Customization :

Problem with Spaces in Search Form

Quote Reply
Problem with Spaces in Search Form
Hi y'all.

I have come accross a bug in DBMAN...When I type words in one of the fields I have in the search forms (view, modify, and delete) with spaces at the beginning or end of the
field/blank...I get a search error. I was wondering if there are some codes to insert in the sub query sub-routine that would take care of this problem.

(I apologize if this is a cross posting between DBMAN Installation Forum or a redundant posting. I spent about a half hour searching through both forums and could not find an answer or similar problem.)

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited August 11, 1999).]
Quote Reply
Re: Problem with Spaces in Search Form In reply to
This shouldn't be a problem at all, since sub parse_form takes out any leading or trailing spaces. Are you sure that's the source of the problem?

What kind of search error are you getting?

------------------
JPD





Quote Reply
Re: Problem with Spaces in Search Form In reply to
Hi, JPDeni....

The Error Message is:

no matching records

The search form is on a static web page. I used your advice that you gave in another Thread by taking out:

Code:
<input type="hidden" name="view_records" value="1">

AND

<input type="submit" name="view_records" value="Search">

Even when I had these codes in place, I was still getting no matching records.

When I submit a name with no space, the record comes up fine.

Take a look at this example and test it out for yourself (when you get a chance Smile ):

http://www.coco.cc.az.us/_private/newdefault.asp

Thanks for the quick response. Smile

Regards,



------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Problem with Spaces in Search Form In reply to
I was wrong about where the script strips leading and trailing spaces. I thought it was sub parse_form. It's sub join_encode, where the values are processed.

You might try adding the following lines to sub parse_form:

Code:
$value =~ s/^\s+//g; # Trim leading blanks...
$value =~ s/\s+$//g; # Trim trailing blanks...

I would put it after

Code:
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

I don't know if it will work, but it might.

I don't recall telling anyone to use both

<input type="hidden" name="view_records" value="1">
AND
<input type="submit" name="view_records" value="Search">

It probably won't hurt anything, though.

------------------
JPD





Quote Reply
Re: Problem with Spaces in Search Form In reply to
Thanks, Carol. I will try that tomorrow.

Thanks again for your quick and efficient response.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Problem with Spaces in Search Form In reply to
Thanks, Carol!

It worked like a charm....

Smile

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us