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