Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Need help with a special search!

Quote Reply
Need help with a special search!
Hi,

i just added a field into links sql2 for 5 digits - no problem so far Smile

Now i want to add a search box with a pulldown-menu for searching from 00000 to 10000, 10001 to 20000, ...., 80001 to 99999.

First: Any idea how to build a form like this?

Second: Is it possible to change the search-function in that way, that a "special" search only searches in one field of the links-database?

Thanks for hints.

Quote Reply
Re: Need help with a special search! In reply to
Hi,

Yes, you can use fieldname-lt or fieldname-gt to do less than or greater than searches. You can combine this with a regular search, or just pass it into search.cgi by itself.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Need help with a special search! In reply to
Thanx Alex - could you describe your answer a bit softer for a newbie?

:-)



Quote Reply
Re: Need help with a special search! In reply to
Sure, actually, re-reading it you would have to do it in two drop down boxes:

Search Between

<select name="price-gt"><option>00000<option>10000<option>20000..</select>

and

<select name="price-lt"><option>00000<option>10000<option>20000..</select>

where 'price' is the name of your custom field. If you submit that to the search engine search.cgi, it will find all results between the ranges that are selected. If you wanted it in one field, it would take a little javascript to do it, or some programming.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Need help with a special search! In reply to
Hi Alex,

please take a look:

<form action="<%db_cgi_url%>/search.cgi" method="GET">
Start
<select name="zippie-gt" tabindex="1">
<option value="00000">00000</option>
<option value="10000">10000</option>
<option value="20000">20000</option>
<option value="30000">30000</option>
<option value="40000">40000</option>
<option value="50000">50000</option>
<option value="60000">60000</option>
<option value="70000">70000</option>
<option value="80000">80000</option>
<option value="90000">90000</option>
</select>




End
<select name="zippie-lt" tabindex="1">
<option value="90000">90000</option>
<option value="80000">80000</option>
<option value="70000">70000</option>
<option value="60000">60000</option>
<option value="50000">50000</option>
<option value="40000">40000</option>
<option value="30000">30000</option>
<option value="20000">20000</option>
<option value="10000">10000</option>
<option value="10000">00000</option>
</select>




<font face="Tahoma,Arial" size="1"> <input type=submit value="Search!">
</form>


Would this work?

Thanks for your help!


Quote Reply
Re: Need help with a special search! In reply to
Alex - could you please take a look?

Thanks a lot