ICEfaces
  1. ICEfaces
  2. ICE-4032

Add maxlength attribute to selectInputDate

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7.2 SP1
    • Fix Version/s: 1.7.2
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      All
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      JavaScript:
      <script type="text/javascript">
      function chklen() {
      var un = document.getElementById("form1:date").value
      var len = un.length;
      if (len > 9) {
      alert ("Too many characters in date field!");
      document.getElementById("form1:date").value = un.substring(0,9); // remove excess characters
      return false;
      }
      }

      </script>

      JSPX:
      <ice:form id="form1">
      <ice:selectInputDate id="date" renderAsPopup="true"
      value="#{testBean.date}"
      partialSubmit="true"
      onkeypress="chklen();">
      <f:convertDateTime timeZone="#{testBean.timeZone}"
      pattern="MM/dd/yyyy"/>
      </ice:selectInputDate>
      <ice:messages/>
      </ice:form>
      Show
      JavaScript: <script type="text/javascript"> function chklen() { var un = document.getElementById("form1:date").value var len = un.length; if (len > 9) { alert ("Too many characters in date field!"); document.getElementById("form1:date").value = un.substring(0,9); // remove excess characters return false; } } </script> JSPX: <ice:form id="form1"> <ice:selectInputDate id="date" renderAsPopup="true" value="#{testBean.date}" partialSubmit="true" onkeypress="chklen();"> <f:convertDateTime timeZone="#{testBean.timeZone}" pattern="MM/dd/yyyy"/> </ice:selectInputDate> <ice:messages/> </ice:form>

      Description

      Feature Request: It may be helpful to have an easy way to set a max length for input into the textbox of the selectInputDate component.

        Activity

          People

          • Assignee:
            yip.ng
            Reporter:
            Arran Mccullough
          • Votes:
            4 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: