title: Bootstrap form not calling JS function on submit
body: <p>I have the following code which consists of a form whose on submit calls a javascript function.</p>
  
  <pre><code>&lt;div class="form" role="form" onsubmit="createresult()"&gt;
      &lt;fieldset&gt;
      &lt;?php
          $subject = $_GET["sub"];
          $array = mysqli_query($con, "Select * from questions where subject='$subject'");
          $j =1;
          while($row = mysqli_fetch_array($array))
          {
              echo "
              &lt;div class=\"form-group\"&gt;&lt;h5&gt;$row[question]&lt;/h5&gt;";
                  for($i=1;$i&lt;5;$i++)
                  {
                      $opt1 = "option".$i;
                      $opt = $row[$opt1];
                      $name = "question" ."$j";
                      echo "
                  &lt;label class=\"radio-inline\"&gt;
                  &lt;input type=\"radio\" name=$name required&gt;$opt&lt;/label&gt;";
              }
              echo "&lt;/div&gt;";
              $j++;
          }
          ?&gt;
  
      &lt;button type="submit" class="btn btn-primary" name="submit"&gt;Submit&lt;/button&gt;
      &lt;button type="reset" class="btn btn-primary"&gt;Reset&lt;/button&gt;
      &lt;/fieldset&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The PHP script is working fine but this form is not calling the JavaScript function <code>createresult()</code>.</p>