Gossamer Forum
Home : Products : DBMan : Customization :

Matching two db fields from html search page

Quote Reply
Matching two db fields from html search page
I have a search form on an html page that only uses two fields of the db for searching. the first field is account number and the second is company name, I can search by either field and find the record. My problem is that I need to have the search form match both fields not just one or the other. Can you offer some advice?

This is the complete code that I use in my html form:
<form action="http://www.mydomain.com/cgi-bin/db.cgi" method="GET">
<input type="hidden" name="db" value="acct"><input type="hidden" name="uid"
value="default"><center>
<table border="1" bgcolor="#FFFFFF" cellpadding="5" cellspacing="3"
width="500" align="center" valign="top">
<tr>
<td>
<p>
<center>
<font face="verdana,arial,helvetica" size="4"><b>Corporate
Account Reservations</b></font>
</center>
<table border="0">
<tr>
<td align="right" valign="top" width="20%"><font
face="verdana,arial,helvetica" size="2">Account Number:</font></td>
<td width="80%">
<input type="text" name="Account" value size="6"
maxlength="6">
</td>
</tr>
<tr>
<td align="right" valign="top" width="20%">
<p><font
face="verdana,arial,helvetica" size="2">Company </font><font
face="verdana,arial,helvetica" size="2">Name:</font></p>
</td>
<td width="80%">
<input type="text" name="AcctName" value size="30"
maxlength="30">
</td>
</tr>
</table>
<p>
<center>
<input type="SUBMIT" name="find_records" value="Submit">
<font face="Verdana, Arial, Helvetica" size="2">| </font>
</center>
</p>
</td>
</tr>
</table>
</center>
</form>


Quote Reply
Re: Matching two db fields from html search page In reply to
Add the following:

Code:
<input type="hidden" name="ww" value="on">

This is the Whole Word codes that will match whole characters in these two fields. If this doesn't work, then use the Exact Word Match located somewhere in this Forum or in the FAQ section of the Resource Center.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
http://www.anthrotech.com
Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
----------------------





Quote Reply
Re: Matching two db fields from html search page In reply to
I'm still getting the same results.
In filling out the search form if you type in a good account number with the corresponding company name this form sends you on to another html page.
My problem is that if type in a good account number and leave the company name blank the form sends you to the next step, or if you type in a good company name and leave the account number blank the form sends you to the next step. I need to have the form search and match both of the input fiels before sending the user on to the next page.
Quote Reply
Re: Matching two db fields from html search page In reply to
Ah...I see the problem...You are looking for a combination of the EXACT WORD MATCH and also an AND search capability (which is not available out of box).

There are some Threads in this Forum that discuss adding codes for AND/OR searching. Search this forum again.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
http://www.anthrotech.com
Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
----------------------





Quote Reply
Re: Matching two db fields from html search page In reply to
You could use some simple Javascript to make sure neither field is left empty. It would be a lot easier than trying to mod the search routines. Here is one worth trying to see if it works for you... http://javascript.internet.com/...asic-validation.html

------------------
The Immuatable Order of Modding
-=-=-=-=-=-=-=-
1. Read the FAQ, 2. Search the board, 2a. Search the board again, 3. ask the question, 4. back-up, 5. experiment, 6. rephrase question (or better yet, post solution to original question)
Quote Reply
Re: Matching two db fields from html search page In reply to
Eliot
I tried searching for AND/OR searches and I can't find anything. Can you point Me in the right direction.


Oldmoney
I tried using the java script you suggested and it gives me an error "document.********" is not an object have you seen this before???


I'm lost in the sauce HELP HELP HELP!!!!