ICEfaces
  1. ICEfaces
  2. ICE-3458

Add maxlength attribute to inputTextarea

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7.1
    • Fix Version/s: 1.8.1
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      All
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      Use Javascript to replicate similar behavior

      JavaScript:
           <script language="javascript">
                      function textCounter(field,maxlimit) {
                          if (field.value.length > maxlimit)
                              field.value = field.value.substring(0, maxlimit);
                          
                      }
           </script>

      Component:

      <ice:inputTextarea id="text"
                                         cols="50"
                                         rows="3"
                                         value="#{testBean.text}"
                                         onkeydown="textCounter(this, 20)"/>
      Show
      Use Javascript to replicate similar behavior JavaScript:      <script language="javascript">                 function textCounter(field,maxlimit) {                     if (field.value.length > maxlimit)                         field.value = field.value.substring(0, maxlimit);                                      }      </script> Component: <ice:inputTextarea id="text"                                    cols="50"                                    rows="3"                                    value="#{testBean.text}"                                    onkeydown="textCounter(this, 20)"/>

      Description

      The inputText component has a maxlength attribute which will limit the characters in the component. There has been a request for this feature to be added onto the inputTextarea component.

        Issue Links

          Activity

            People

            • Assignee:
              Mark Collette
              Reporter:
              Arran Mccullough
            • Votes:
              11 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: