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

        Arran Mccullough created issue -
        Arran Mccullough made changes -
        Field Original Value New Value
        Salesforce Case [50070000007cfbq]
        Priority Major [ 3 ] Minor [ 4 ]
        Arran Mccullough made changes -
        Workaround Description 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>
        Workaround Exists [Yes]
        Adnan Durrani made changes -
        Assignee Adnan Durrani [ adnan.durrani ]
        Ken Fyten made changes -
        Assignee Adnan Durrani [ adnan.durrani ]
        yip.ng made changes -
        Assignee yip.ng [ yip.ng ]
        yip.ng made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 1.7.2 [ 10130 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: