Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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


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

0 votes



2 answers

Permanent link
  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.

0 votes


Permanent link
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/

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 6,117

Question asked: Jul 24 '18, 5:08 p.m.

Question was seen: 1,489 times

Last updated: Jul 25 '18, 7:30 a.m.

Confirmation Cancel Confirm