Skip to main content
A newer version of this page is available. .

ASPxClientTextEdit.KeyUp Event

Occurs on the client-side when an end-user releases a pressed key while the editor has focus.

Declaration

KeyUp: ASPxClientEvent<ASPxClientEditKeyEventHandler<ASPxClientTextEdit>>

Event Data

The KeyUp event's data class is ASPxClientEditKeyEventArgs. The following properties provide information specific to this event:

Property Description
htmlEvent Gets a DHTML event object that relates to the processed event.

Remarks

The editors’ client-side functionality provides the ability to respond to key presses and releases made by end users. Each time an end-user releases a key while an editor has focus, the KeyUp event fires. This event can be handled to implement custom processing of the released key.

Using the ASPxClientEditKeyEventArgs.htmlEvent property of the event’s argument you can obtain the necessary information related to the pressed key (such as its key code, the modifier key pressed, etc).

Note

The GetText method returns a string calculated based on a current editor’s value and the editor’s formatting settings (mask settings, the DisplayFormatString and EditFormatString properties, etc.). In this case, it is required to synchronize a text entered by an end user with an editor’s value before you use the GetText method. For example, if an editor loses focus, the editor automatically calculates (synchronizes) its value based on the entered text.

The GetText method returns an empty value or a previous editor’s text if you call this method before the editor calculates its a new editor’s value. For example, in the client-side UserInput, KeyDown, KeyPress, KeyUp event handlers, this method will return an empty value or a previous editor’s text. In this case, obtain an editor’s text directly from the editor’s input element:

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

The GetText method return a correct value only for the text box. For a combo box, token box, color editor and date edit you should press Enter to submit a value.

See also: Bug Report: ASPxTextBox - The client-side GetText method returns an empty value if a text decoration (for example, a null text) is applied to editor

Example

The following example illustrates how to use the KeyUp event.


function onKeyUp(s, e) {
    setTimeout(function(){
        ASPxTextBox2.SetText(s.GetText());
        }, 100);
}
See Also