It's all about the answers!

Ask a question

How do I limit the amount of characters in a text field in the RTC??


Gilberto Ferraiuolo Junior (112) | asked Jul 24 '18, 5:08 p.m.

How do I limit a text field in the RTC to 250 characters?

2 answers



permanent link
christiana desouza (111) | answered Jul 25 '18, 12:54 a.m.
edited Jul 25 '18, 7:30 a.m.
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/


permanent link
Ralph Schoon (63.3k33646) | answered Jul 25 '18, 2:36 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
  1. All the Text and HTML attributes have limitations in their sizes anyway.
  2. 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.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.