title: Toggle element on selection from dropdown menu in Bootstrap 3.0
body: <p>I'm using Bootstrap <code>3.0</code> for Ruby on Rails <code>4.2.5</code>, and I need to make it so that in this form when the user selects the option "No" from the drop down menu, the next text field is shown to them, otherwise, the text field remains hidden.  I've found a similar question with this solution, but I couldn't implement it with the Bootstrap form, this is my attempt at it :  </p>
  
  <p>Dropdown Input: 
    <code>&lt;%= f.select :answer, [["Yes", 1], ["No", 0]], label: "Do you wish to bla bla? ", class: "selectpicker", Id: "selectpicker" %&gt;</code>  </p>
  
  <p>Toggled Input (should show when "No" is picked) :<br>
    <code>&lt;%= f.text_area :explain , label: "Please explain why not", Id: "sdd"%&gt;</code>  </p>
  
  <p>Javascript:  `</p>
  
  <pre><code> ("selectpicker").change(function changetextbox());
   function changetextbox()
  {
      if (document.getElementById("selectpicker").value === 0 ) {
          document.getElementById("sdd").disable='true';
      } else {
          document.getElementById("sdd").disable='false';
      }
  }
  </code></pre>
  
  <p>`</p>
  
  <p>I tried changing <code>value === 0</code> to <code>value == 0</code> and the <code>0</code> to <code>No</code>, but it still doesn't work.</p>
  
  <p>They're in my code in this order, but I'm not sure how this should work with the bootstrap form tags. Thanks in advance. </p>
  
  <p><em>Reference</em> : This is the question from which i got this code
  <a href="https://stackoverflow.com/questions/5258182/enable-disable-of-textbox-on-option-selected-from-drop-down-menu">Enable/disable of textbox on option selected from drop down menu</a></p>