This is a migrated thread and some comments may be shown as answers.

Set empty searchbox message on button click

1 Answer 95 Views
SearchBox
This is a migrated thread and some comments may be shown as answers.
Freddy
Top achievements
Rank 1
Freddy asked on 05 Mar 2013, 08:19 AM
Hi,

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

Thank you,
Freddy.

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 05 Mar 2013, 10:32 AM
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.
Tags
SearchBox
Asked by
Freddy
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or