title: How use mask in input field in JSF 2 + RichFaces 4?
body: <p>I need to have some masks in my input fields in my form.
  I try to insert the <code>jQuery.js</code> and <code>jQuery.MaskedInput.js</code> as show in the code below:</p>
  
  <p>
  </p>
  
  <pre><code>&lt;h:head&gt;
      &lt;h:outputScript name="jquery-1.6.4.min.js" library="javascript" /&gt;
      &lt;h:outputScript name="jquery.maskedinput-1.3.js" library="javascript" /&gt;
  
      &lt;script&gt;
          jQuery(function($){
             $("#date").mask("99/99/9999");
             $("#phone").mask("(999) 999-9999");
             $("#tin").mask("99-9999999");
             $("#ssn").mask("999-99-9999");
         });
      &lt;/script&gt;
  
      &lt;title&gt;TITLE&lt;/title&gt;
  &lt;/h:head&gt;
  
  &lt;h:body&gt;
       &lt;h:form id="form"&gt;
          &lt;h:inputText id= "date"  /&gt;
      &lt;/h:form&gt;
  &lt;/h:body&gt;
  </code></pre>
  
  <p></p>
  
  <p>BUt nothing so far.</p>
  
  <p><strong>UPDATE</strong>
  With BalusC <code>$("[id='form:phone']").mask("(99) 9999-9999");</code> it works fine! (thanks dude).
  But I need apply this mask in a datatable :</p>
  
  <pre><code>&lt;script&gt;
      jQuery(function($){
         $("input.phones").mask("(999) 999-9999");
     });
  &lt;/script&gt;
  
  &lt;title&gt;TITLE&lt;/title&gt;
  </code></pre>
  
  <p></p>
  
  <p></p>
  
  <pre><code> &lt;h:form id="form"&gt;
  
     &lt;h:panelGrid columns="3"&gt;
          &lt;h:outputLabel for="phones" value="Telefone(s) :" /&gt;                
          &lt;h:dataTable id="phones" value="#{profile.user.userPhones}" var="item"&gt;
              &lt;h:column&gt;
                  &lt;h:inputText id= "phone" value="#{item.phone}" /&gt;
              &lt;/h:column&gt;
              &lt;h:column&gt;
                  &lt;h:commandButton value="Remove" action="#{profile.removePhone}"/&gt;
              &lt;/h:column&gt;
              &lt;h:column&gt;
                  &lt;rich:message id="m_phone" for="phone" /&gt;
              &lt;/h:column&gt;
          &lt;/h:dataTable&gt;
      &lt;h:commandButton value="Add" action="#{profile.addPhone}"/&gt;
     &lt;/h:panelGrid&gt;    
  
  &lt;/h:form&gt;
  </code></pre>
  
  <p></p>
  
  <p>Any idea ?</p>