What is the Validator in SimpleSearch.ascx?

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
Mike718NY
Commodore (COMO)
Commodore (COMO)
Posts: 485
Joined: Wed Jun 18, 2008 5:24 pm

What is the Validator in SimpleSearch.ascx?

Post by Mike718NY » Thu Nov 12, 2009 12:11 pm

In the SimpleSearch.ascx, there is a validator " keyword must be at least {0} characters in length . . .", but is it being used?
If I type 2 or less characters I don't see that message:

Code: Select all

<asp:TextBox ID="SearchPhrase" runat="server" CssClass="searchPhrase" Columns="30" MaxLength="60"></asp:TextBox>
<asp:Button ID="SearchButton" runat="server" Text="&nbsp;GO!&nbsp;&nbsp;&nbsp;" 
     OnClick="SearchButton_Click" CssClass="searchButton2" SkinID="ignore" CausesValidation="true" ValidationGroup="Search"
     OnClientClick="if(Page_ClientValidate('Search')){{window.location='{0}?k='+encodeURIComponent({1}.value);}}return false;" />
<cb:SearchKeywordValidator ID="SearchPhraseValidator" runat="server" ControlToValidate="SearchPhrase" 
    ErrorMessage="Search keyword must be at least {0} characters in length excluding spaces and wildcards."
    Text="*" ValidationGroup="Search" Display="None" KeywordRequired="true"></cb:SearchKeywordValidator>  

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: What is the Validator in SimpleSearch.ascx?

Post by jmestep » Thu Nov 12, 2009 1:58 pm

I get an error if they keyword is fewer characters than what is in the store settings in the admin. Maybe you haven't entered anything there.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

Mike718NY
Commodore (COMO)
Commodore (COMO)
Posts: 485
Joined: Wed Jun 18, 2008 5:24 pm

Re: What is the Validator in SimpleSearch.ascx?

Post by Mike718NY » Thu Nov 12, 2009 2:27 pm

There was 1 in there (the Minimum Search Length).
I set it to 2 and it displayed the message.

But you can still enter nothing and it returns all products ???

I don't know if this is useful or not. I'll probably just take it out.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: What is the Validator in SimpleSearch.ascx?

Post by mazhar » Fri Nov 13, 2009 6:09 am

We have discussed something similar here
http://bugs.ablecommerce.com/show_bug.cgi?id=8303
I was unable to reproduce it.

Post Reply