title: How to enable/disable <p:inputtext> depending on selecting values from<p:selectonemenu> dropdown in jsf
body: <p>We are using JSF 2.2.4 and PrimeFaces 5 to develop some form fields.  </p>
  
  <p>For example: company and short code is my drop down and 'If you have selected Other' is my input-text field. So if user selects 'others' from the drop down the 'If you have selected Other' text field should be enabled, otherwise it should be disabled. 
  Below is my code:</p>
  
  <pre><code>&lt;p:outputLabel value="Company Name and Shortcode:* " escape="true" /&gt;
  
  &lt;p:selectOneMenu  value="#{user.shipper}" effect="fold" required="true" id="selectone" autocomplete="off" 
       requiredMessage="#{error['form.shippershortcode']}"  widgetVar="selectWV"  &gt;
          &lt;f:selectItem itemLabel="----" itemDisabled="true"  /&gt;
          &lt;f:selectItems value="#{shipperdropdown.shipperlist}"  /&gt;
  
  
  &lt;/p:selectOneMenu&gt;
  
      &lt;p:outputLabel  value="If selected ‘Other’ above, please specify:" 
                   escape="true"  /&gt;
                 &lt;p:inputText  value="#{user.companyname}" 
                autocomplete="off"  id="company"  disabled="#{ user.shipper !='Others'}"  /&gt;
  </code></pre>