JSFiddle - React, Tailwind, and code Playground

by Lucas Costa

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<h4>Formulário 1</h4>
<form id="form1" method="POST" action="">
  <input id="form1Campo1" name="form1Campo1" />
  <input id="form1Campo2" name="form1Campo2" />
  <input type="submit" />
</form>

<h4>Formulário 2</h4>
<form id="form2" method="POST" action="">
  <input id="form2Campo1" name="form2Campo1" />
  <input id="form2Campo2" name="form2Campo2" />
  <input type="submit" />
</form>

<h4>Formulário 3</h4>
<form id="form3" method="POST" action="">
  <input id="form3Campo1" name="form3Campo1" />
  <input id="form3Campo2" name="form3Campo2" />
  <input type="submit" />
</form>

JavaScript

$("#form2").submit(function(event) {
  event.preventDefault();
  var form1Campo1 = $("#form1Campo1").val(),
      form1Campo2 = $("#form1Campo2").val();

  if (!form1Campo1 || !form1Campo2)
    alert("Primeiro preencha o primeiro formulário");
  else {
    // post por ajax  
  }
});