title: Add a new form based on another form's data?
body: <p>I have a dropdown menu that allows the user to select a time period (ie: January 2018, 1st Trimester, Summer 2018, etc.). At the very bottom there's an option labelled "Other". How can I make it so that if the user selects "Other", and text-input form appears beneath that so that they can elaborate on what "Other" means? Here's my current code:</p>
  
  <p>HTML:</p>
  
  <pre><code>Time Period:
  &lt;% if f.object.award.add_period? %&gt;
      &lt;div class="time_period_&lt;%= f.object.award.id %&gt;" id="otherBoolID"&gt;
          &lt;%= f.select :time_period, Award::TimePeriods, {:include_blank =&gt; true}, { :class =&gt; "date_dropdown"} %&gt;
      &lt;/div&gt;
  &lt;% end %&gt;
  
  &lt;div  id="boolID" &lt;%= "hidden" %&gt;&gt;
      &lt;%= f.input :time_period, :label =&gt; false, placeholder: "Other (please specify)", :input_html =&gt; { :class =&gt; 'awardform' } %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JavaScript/JQuery:</p>
  
  <pre><code>$('#otherBoolID').change(function () {
  var x = document.getElementById('otherBoolID').value;
  if (x == "Other") {
      document.getElementById('boolID').style.display = 'visible';
  }
  });
  </code></pre>
  
  <p>Any idea what's going wrong? Currently the "other" form is hidden on page load, but doesn't become visible if you select "Other" in the dropdown menu. If it's worth mentioning, I'm working with a ruby on rails framework.</p>