Plain text length control
User can see how many characters he still can type :
Server side controls submitted plain text length, try to click SUBMIT button.
Example code
// Max plain text length
int maxPlainTextLength = 127;
...
<ed:Editor id="editor" OnClientContentChanged="onClientContentChanged" ... />
...
<script type="text/JavaScript">
function onClientContentChanged(status)
{
var curLeft = <%= maxPlainTextLength %> - status.current.plainTextLength;
document.getElementById("charsLeft").value = curLeft;
document.getElementById("charsLeft").style.color = (curLeft >= 0)?"#0033CC":"#FF0000";
}
</script>
| | |
|