2 posts, 0 answers
  1. James Daresta
    James Daresta avatar
    59 posts
    Member since:
    Sep 2009

    Posted 26 Mar 2014 Link to this post

    Can you not use the required field validator or others with the search box? It will not let me.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Mar 2014 in reply to James Daresta Link to this post

    Hi James Daresta,

    Please have a look into the sample code snippet to achieve your scenario.

    <telerik:RadSearchBox ID="RadSearchBox1" runat="server" DataSourceID="SqlDataSource1"
    <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="*" ValidationGroup="Group1"
    <telerik:RadButton ID="RadButton1" runat="server" Text="Validate" CausesValidation="true"

    <script type="text/javascript">
        function Validate(sender, args) {
            //check your condition and set  args.IsValid to true or false
            var searchbox = $find("<%=RadSearchBox1.ClientID %>");
            if (searchbox.get_text() == "")
                args.IsValid = false;

    Hope this will helps you.
  3. DevCraft R3 2016 release webinar banner
Back to Top