4 Replies Latest reply on Jan 9, 2012 11:14 PM by Juan Pusong

    jQuery input mask using jquery-maskedinput-1.3.js plugin does not work on rich:calendar.

    Juan Pusong Newbie

      Is there a way to use an input mask on rich:calendar. I am trying to use jquery-maskedinput-1.3.js plugin to force users to enter dates is a specific format and disallow entry of non numeric characters, for example, MM/dd/yyyy. I tried the following code to achieve this:


      <rich:calendar id="dateResigned" value="#{seBean.model.dateResigned}" enableManualInput="true"

           inputStyle="width:140px" inputClass="entryFldLA" required="false">

           <rich:jQuery selector="#dateResigned" query="mask('99/99/9999',{placeholder:' '})" timing="onload"/>



      Although the above code does not throw any error, still, it does'nt work. When data is entered on the field, nothing happens, and even non-numeric fields are allowed.


      I have successfully used the plugin to mask <h:inputText>. For example, the following mask work just fine:


      <h:inputText id="sssNo" value="#{seBean.model.sssNo}" size="22" styleClass="entryFldLA">

         <rich:jQuery selector="#sssNo" query="mask('99-9999999-9',{placeholder:' '})" timing="onload"/>



      I am using richfaces-ui-3.3.3.Final and running the app in Tomcat v 7.0.6 on windows 7.


      What could be causing the problem?


      Any help would be highly appreciated.