How do I limit the amount of characters in a text field in the RTC??
2 answers
This will help you to limit the characters in text field
<script language="javascript" type="text/javascript">
function limitText(limitField, limitNum) {
if (limitField.value.length > limitNum) {
limitField.value = limitField.value.substring(0, limitNum);
}
}
</script>
<input type="text" id="sessionNo" name="sessionNum" onKeyDown="limitText(this,5);"
onKeyUp="limitText(this,5);"" />
Visit: https://rospher.com/
- All the Text and HTML attributes have limitations in their sizes anyway.
- It would be possible to create an attribute customization based validator ( https://jazz.net/wiki/bin/view/Main/AttributeCustomization ) it would have to get the text value and check its length.