New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

OnFocus

The OnFocus client-side event handler is called when the input control gets focus.

The OnFocus event is supported by all RadInput controls, if they are not ReadOnly .

Two parameters are passed to the event handler:

  • sender is the input control.

  • eventArgs is an instance of Sys.EventArgs.

The following example uses the OnFocus event to show an alert:

<telerik:RadTextBox RenderMode="Lightweight" ID="RadTextBox1" runat="server">
    <ClientEvents OnFocus="Focus" />
</telerik:RadTextBox>
<script type="text/javascript">
    function Focus(sender, eventArgs)
    {
        alert(sender.get_id());
    }
</script>

See Also

In this article