Skip to main content

ASPxClientTextEdit.GetText Method

Returns the text displayed within the editor.

Declaration

GetText(): string

Returns

Type Description
string

A string value representing the editor’s display text.

Remarks

The GetText and the GetValue methods can return an incorrect (empty or previous) value in the client-side UserInput, KeyDown, KeyPress, and KeyUp event handlers when you apply a format, mask, or null text settings to a text editor.

In this case, obtain the editor’s text from the editor’s input element:

function OnUserInput(s, e) {  
    var currentText = s.GetInputElement().value;  
}

For more information refer to the following Support Center ticket: ticket.

Example

<dx:ASPxTextBox ID="ASPxTextBox1" runat="server" Width="170px" ClientInstanceName="textBox"></dx:ASPxTextBox>
<dx:ASPxButton ID="ASPxButton1" runat="server" Text="Set Label Text" AutoPostBack="False" >
    <ClientSideEvents Click="function(s, e) {   label.SetText(textBox.GetText()); }" />
</dx:ASPxButton>
<dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="" ClientInstanceName="label">
</dx:ASPxLabel>

Online Example

See Also