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

clear the content of RadTextBox

1 Answer 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Erin
Top achievements
Rank 1
Erin asked on 23 Dec 2013, 02:47 PM
Hi.
I want to clear the content of RadTextBox when user focuses on a textbox so that the user can enter any text.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 23 Dec 2013, 02:52 PM
Hi Erin,

Please try the following code snippet:

ASPX:
<telerik:GridTemplateColumn>
    <ItemTemplate>
        <telerik:RadTextBox ID="RadTextBox1" runat="server" Text="Enter Text: ">
            <ClientEvents OnFocus="onfocus" />
        </telerik:RadTextBox>
    </ItemTemplate>
</telerik:GridTemplateColumn>

JS:
<script type="text/javascript">
    function onfocus(sender, args) {
        sender.clear();
    }
</script>

Thanks,
Shinu

Tags
Grid
Asked by
Erin
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or