Page 1 of 1

What is the Validator in SimpleSearch.ascx?

Posted: Thu Nov 12, 2009 12:11 pm
by Mike718NY
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>  

Re: What is the Validator in SimpleSearch.ascx?

Posted: Thu Nov 12, 2009 1:58 pm
by jmestep
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.

Re: What is the Validator in SimpleSearch.ascx?

Posted: Thu Nov 12, 2009 2:27 pm
by Mike718NY
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.

Re: What is the Validator in SimpleSearch.ascx?

Posted: Fri Nov 13, 2009 6:09 am
by mazhar
We have discussed something similar here
http://bugs.ablecommerce.com/show_bug.cgi?id=8303
I was unable to reproduce it.