Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Built In Search Engine Question

Status
Not open for further replies.

kennyharrill

Programmer
May 14, 2005
7
US
We have a search engine built in on our website (this website is for a company that makes heat transfers). We are wanting to put something in place that keeps our three digit partcodes from displaying - we want to make the mininum length of the search entry four characters or digits. I have cut and paste the search form tags below - please note that the link in the action parameter is a dummy one and not our real site. Any help that anyone can give us will be greatly appreciated.

<FORM NAME="Search" METHOD="post" ACTION=" <INPUT NAME="ListAUX1" TYPE="hidden" VALUE="A">
<INPUT NAME="DATA" TYPE="text" VALUE="" SIZE="15">
<!--<INPUT NAME="Go" TYPE="image" VALUE="submit" SRC="images/submit.gif" ALT="GO!" align="texttop">-->
<A HREF="javascript:document.Search.submit()" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','send','images/submit2.gif','images/submit.gif',1)" onClick="MM_nbGroup('down','navbar1','send','images/submit.gif',1)"><IMG SRC="images/submit.gif" BORDER="0" name="send" align="absmiddle"></A>
<INPUT NAME="CONT" TYPE="hidden" VALUE="Contains">
<INPUT NAME="ADDITIVE" TYPE="hidden" VALUE="BANDC1">
<INPUT NAME="COLUMNS" TYPE="hidden" VALUE="3">
<INPUT NAME="CATCODE" TYPE="hidden" VALUE="">
<INPUT NAME="SUBCATCODE" TYPE="hidden" VALUE="">
<INPUT NAME="SEARCHMORE" TYPE="hidden" VALUE="Search Results,2,158,#,blkt,&,158,#,otherdo,&,158,#,otherdg,&,158,#,embm,&,158,#,embw,&,158,#,emby,&,158,#,embwwh,&,158,#,embmwh,&,158,#,embywh,&,158,#,otherdowh,&,158,#,otherdgwh,&,158,#,baby,&,158,#,babywh,&,158,#,blktwh,&,158,#,blnkwh,&,158,#,pants">
</FORM>
 
There's nothing you can do from html point of view. You could use Javascript to not allow form submissions if search field is less than four characters long. However, that solution won't work with people that have javascript turned off, so relying on client side solution is not the best. Therefore, I suggest you do that in the script that searches. Since you changed the action, we do not know what kind of script it is, but whatever it is, it has a specialized forum here that deals with that language (I gather it is most likely perl). Just make sure you won't later regret this when people try to search by "legitimate" three letter words and come up with nothing.
 
Vragabond: Thanks for your reply. The tags were cut and paste from a PHP script. Hope that helps.
 
So I suggest you ask in the PHP forum (forum434), since your problem will have to be solved in the server-side scripting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top