editablelabel_change_handler

Client side event handler for EditableLabel.ClientSideOnChange event.

Note: This is a prototype, not a function. You should provide a function that matches this prototype if you wish to handle the corresponding event on the client side. The prototype provides information about the arguments and return value of the function you provide.

Syntax
JavaScript
 editablelabel_change_handler(editableLabel, newText)

Parameters

editableLabel
The EditableLabel object that caused this event.
newText
The new text.
Remarks

This handler is called after user has changed the text of the EditableLabel control but before the change has been accepted. You can modify the text in this handler, or to return false from this handler to cancel the change.

To modify the text, simply return a new text. For example, the following code truncates the text user entered if the text is more than 10 characters long:

JavaScript
function change_handler(editableLabel, newText)
{
    if (newText.length > 10)
        return newText.substr(0, 10);
    else
        return newText;
}
See Also