Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Subject: strange search box

Original Message
Name: neonwill
Date: February 27, 2008 at 06:25:57 Pacific
Subject: strange search box
OS: xp
CPU/Ram: 1GB
Model/Manufacturer: Dell
Comment:
hi i am having a problem with my search box.(for example i have a product online name "lamp, hanging style, black" for me to search it i have to type in order to search it i can't type "black lamp" because its not gonna find it, but if i type "lamp, hang" then i can find it... any body know why? here is the code for that box

<%
':: Accware Online
':: ?Copyright 2000, ICODE Inc
':: Template: AMAZING
'*** Search.asp
%>

<script Language = "Javascript">
function submitMainsearch()
{

/*
if (document.Mainsearch.edtSearchWords.value.indexOf(" ") == 0)
{
alert("Search string should not start with spaces.");
document.Mainsearch.edtSearchWords.focus();
return false;
}
if (document.Mainsearch.edtSearchWords.value.indexOf("\"") > -1 )
{
alert("Please enter a valid Search String.");
document.Mainsearch.edtSearchWords.focus();
return false;
}
if (document.Mainsearch.edtSearchWords.value == "")
{
alert("Please enter a Search String.");
document.Mainsearch.edtSearchWords.focus();
return false;
}

document.Mainsearch.submit();
return true;
*/


var strValue;
strValue = new String(document.Mainsearch.edtSearchWords.value);
var strLen = strValue.length;

if ((strValue == "")||(strValue==" "))
{
alert("Please enter a Search String.");
document.Mainsearch.edtSearchWords.focus();
return false;
}
if (document.Mainsearch.edtSearchWords.value.indexOf("\"") > -1 )
{
alert("Please do not enter \" inside Search String.");
document.Mainsearch.edtSearchWords.focus();
return false;
}
if(strValue.charAt(strLen-1)=="\\")
{
alert("Please do not end Search String with \\.");
document.Mainsearch.edtSearchWords.focus();
return false;
}

//*** Checking for all spaces - Starts here
var AllSpaces = true;
for (i = 0; i < strValue.length; i++)
{
if (strValue.charAt(i) != " " )
{
AllSpaces = false;
break;
}
}
if (AllSpaces)
{
alert("Please enter a Search String.");
document.Mainsearch.edtSearchWords.focus();
return false;
}
//*** Checking for all spaces - Ends here

document.Mainsearch.submit();
return true;
}
</script>

<%

Function search_FormatString(strName)
Dim m_Name, m_Temp

m_Name = UCase(Mid(strName,1,1)) & LCase(Mid(strName,2))
m_Temp = 0

While m_Temp <> -1
m_Temp = inStr(m_Temp+1,m_Name," ")
If m_Temp > 0 Then
m_Name = Mid(m_Name,1,m_Temp) & UCase(Mid(m_Name,m_Temp+1,1)) & Mid(m_Name,m_Temp+2)
Else
m_Temp = -1
End If
Wend
m_Name=Mid(m_Name,1,12) &"..."
search_FormatString = m_Name
End Function
'*** End Function
%>
<form name = "Mainsearch" method="post" action ="<%=g_NonSecurePath%>searchresult.asp?CartId=<%=cartid%>" onSubmit="return submitMainsearch('search','','');">
<input type="hidden" name="from">
<input type="hidden" name="FrmSearchWords">
<%Set objThirdParty = objSearch.GetThirdPartyInfo%>

thanx


Report Offensive Message For Removal

Response Number 1
Name: Jennifer SUMN
Date: February 27, 2008 at 06:37:29 Pacific
Subject: strange search box
Reply: (edit)
You may want to ask Justin to move this to the Web Development or Programming Forum.

Life's more painless for the brainless.


Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: strange search box

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software



Version Tracker Pro
Keep your software current and secure, effortlessly

Click Here for a Free Scan

Driver Agent
Automatically find the latest drivers for your computer.
Click Here for a Free Scan



The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC