title: How to set disable/readonly of <p:inputText> on change of <h:selectOneMenu>?
body: <p>I am using <code>&lt;p:dataTable&gt;</code> within that I used html <code>&lt;table&gt;</code>. I want to disable/readonly PrimeFaces <code>&lt;p:inputText&gt;</code> on <code>&lt;h:selectOneMenu&gt;</code> change event.</p>
  
  <p>I used JavaScript, but it is not working with it.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
   function change(val)
   {          
       //alert(val);
       if(val=="Check")
        {
  
           document.getElementById('bankName').readonly=false;
           document.getElementById('receiptNo').readonly=true;
  
        }
        if(val=="Cash")
        {
  
            forms.elements["mainForm:chkNo"].readonly=true;
            document.getElementById('chkNo').readonly=true;
            document.getElementById('bankName').readonly=true;
            document.getElementById('receiptNo').readonly=false;              
  
        }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>JSF Code</p>
  
  <pre><code>&lt;h:column&gt;
                              &lt;p:dataTable id="paymentHistoryDataTable" var="due" 
                                           &gt;
  
                                  &lt;p:column&gt;
                                      .......
  </code></pre>
  
  <p></p>
  
  <pre><code>                                    &lt;table id="paymentProcess"&gt;
                                          &lt;tr&gt;                                                
                                              &lt;td style="width: 80px;"&gt;
                                          &lt;h:selectOneMenu value="#{adminActionController.tempBean.selectType}" id="type" onchange="change(this.value);"&gt;
                                              &lt;f:selectItem itemLabel="Check" itemValue="Check"/&gt;
                                              &lt;f:selectItem itemLabel="Cash" itemValue="Cash"/&gt;
                                          &lt;/h:selectOneMenu&gt;
                                          &lt;/td&gt;
                                          &lt;/tr&gt;
                                          &lt;tr id="check"&gt;
                                              &lt;td&gt;&lt;/td&gt;
                                              &lt;td&gt;&lt;/td&gt;
                                              &lt;td style="width: 90px;" id="lblChk"&gt;
                                                  &lt;label&gt; &lt;h:outputText value="Check/DD Number:" /&gt; &lt;/label&gt;
                                              &lt;/td&gt;
                                              &lt;td style="width: 90px;"&gt;
                                          &lt;h:inputText id="chkNo" value="#{adminActionController.tempBean.checkNumber}"  immediate="true"
                                                       required="false" validatorMessage="insert Check/DD number"&gt;
                                          &lt;/h:inputText&gt;
                                          &lt;/td&gt;
  </code></pre>
  
  <p>................
  I want to access id="chkNo" in js for disable it..</p>