function SetMaxLength(memo, maxLength) {
if (!memo)
return;
if (typeof (maxLength) != "undefined" && maxLength >= 0) {
memo.maxLength = maxLength;
memo.maxLengthTimerToken = window.setInterval(function () {
var text = memo.GetText();
if (text && text.length > memo.maxLength)
memo.SetText(text.substr(0, memo.maxLength));
}, 10);
} else if (memo.maxLengthTimerToken) {
window.clearInterval(memo.maxLengthTimerToken);
delete memo.maxLengthTimerToken;
delete memo.maxLength;
}
}
<dx:ASPxMemo Height="80px" CssClass="devxLargeinput midwidtn" ID="txtEnterpriseDo" AutoResizeWithContainer="true" CssPostfix="ConnectToGrow" CssFilePath="~/css/devxpresscustom.css" Width="100%" runat="server">
<ClientSideEvents Init="function(s,e){SetMaxLength(s, 500)}" />
</dx:ASPxMemo>
| |
This email has been checked for viruses by Avast antivirus software.
www.avast.com |
No comments:
Post a Comment