title: condtional input fields in form
body: <p>I want to develop a form that has three input field of which third input with name <code>schoolname</code> should only be visible if age below 15 otherwise it should be hidden. when user enters age below 15 third field should pop up and should be required field. I developed form but when I enter age above 15 the form is not submitting as i set school field as hidden. what should i do to get form submitted if age is above 15 and a mendatory school name field i fage below 15</p>
  
  <pre class="lang-js prettyprint-override"><code>$("#submit").click(function() {
    var age = $("#submit").val();
    if (age &lt; 15) {
      $("#schoolname").show();
    }
  });
  </code></pre>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form&gt;
    &lt;input id="name" type="text" name="name" placeholder="Enter your name" required /&gt;
    &lt;input id="age" type="number" name="age" placeholder="age" required /&gt;
    &lt;input id="schoolname" type="text" name="schoolname" placeholder="Enter your school name" style="display:none" required /&gt;
    &lt;input id="submit" type="submit" name="submit" value="submit"&gt;
  &lt;/form&gt;
  </code></pre>