Set empty searchbox message on button click

2 posts, 1 answers
  1. Freddy
    Freddy avatar
    25 posts
    Member since:
    Feb 2013

    Posted 05 Mar 2013 Link to this post

    Hi,

    How to set an empty message when the user attempt to search without entering any search key in the textbox?

    Thank you,
    Freddy.
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 05 Mar 2013 Link to this post

    Hello Freddy,

    Try attaching the following JavaScript in the OnClientSearch event of the RadSearchBox.

    JavaScript:
    <script type="text/javascript">
        function OnClientSearch(sender, args) {
            if (sender.get_text().length < 1) {
                sender.set_emptyMessage("Your Custom Message");
            }
        }
    </script>

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top