title: submit two forms with a single button jquery ajax
body: <p>I have two forms in one page, and I wanted to submit both with one submit button. I have  tried other solutions in Stackoverflow but couldn't get it. It doesn't redirect to demo.php. Below my code.</p>
  
  <h2>HTML</h2>
  
  <pre><code>&lt;form id="form1" class="multiple-choice"&gt;
      &lt;input id="check1" type="checkbox" name="check" value="check1" class="input-checkboxitem"&gt;
      &lt;label for="check1"&gt;Materials&lt;/label&gt;
      &lt;br&gt;
      &lt;br&gt;
      &lt;input id="check2" type="checkbox" name="check" value="check2" class="input-checkboxitem"&gt;
      &lt;label for="check2"&gt;Exam Method&lt;/label&gt;
      &lt;br&gt;
      &lt;br&gt;
      &lt;input id="check3" type="checkbox" name="check" value="check3" class="input-checkboxitem"&gt;
      &lt;label for="check3"&gt;Learning Method&lt;/label&gt;
      &lt;br&gt;
      &lt;br&gt;
      &lt;input id="check4" type="checkbox" name="check" value="check4" class="input-checkboxitem"&gt;
      &lt;label for="check4"&gt;Evaluation&lt;/label&gt;
      &lt;br&gt;
      &lt;br&gt;
      &lt;input id="check5" type="checkbox" name="check" value="check5" class="input-checkboxitem"&gt;
      &lt;label for="check5"&gt;User Friendliness&lt;/label&gt;
      &lt;br&gt;
      &lt;br&gt;
      &lt;input id="check6" type="checkbox" name="check" value="check6" class="input- checkboxitem"&gt;
      &lt;label for="check6"&gt;None&lt;/label&gt;
  &lt;/form&gt;
  &lt;form id="form2"&gt;
      &lt;input type="radio" name="radiog_dark" id="radio4" class="css-checkbox" /&gt;
      &lt;label for="radio4" class="css-label radGroup2"&gt;Yes&lt;/label&gt;
      &lt;input type="radio" name="radiog_dark" id="radio5" class="css-checkbox"&gt;
      &lt;label for="radio5" class="css-label radGroup2"&gt;No&lt;/label&gt;
      &lt;input type="radio" name="radiog_dark" id="radio6" class="css-checkbox"&gt;
      &lt;label for="radio6" class="css-label radGroup2"&gt;May be&lt;/label&gt;
      &lt;input type="submit" name="submit" value="submit"&gt;&lt;/input&gt;
  &lt;/form&gt;
  &lt;div class="form_result"&gt;&lt;/div&gt;
  </code></pre>
  
  <h2>jquery</h2>
  
  <pre><code>$(document).ready(function(){
          $('form input[type ="radio"], input[type ="checkbox"]' ).click(function(){          
              $.ajax({ type:'POST', url:'demo.php', data:$('#form1, #form2).serialize(),      success:function(response){
                      console.log(response);
                      $('body').find('.form_result').html(response);
                  }
              });
              return false;
          });     
      });
  </code></pre>