title: Problems with outputting error after submit empty fields
body: <p>i have a problem with my script, the only problem is outputting error.
  the error just bricks after submit_button. so that means when the fields are empty it has to output error and it works but the problem the output just bricks</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;&lt;/script&gt;
  &lt;form method="post"&gt;
    &lt;input type="text" id="text_field1" /&gt;
    &lt;input type="text" id="text_field2"&gt;
    &lt;button type="submit" id="submit_button"&gt;Submit&lt;/button&gt;
    &lt;button type="submit"&gt;Submit&lt;/button&gt;
    &lt;p id="error_resp"&gt;&lt;/p&gt;
  &lt;/form&gt;
  &lt;script&gt;
    $("#submit_button").click(function() {
      if ($("#text_field1").val() == "")
        $('#error_resp').text('please fill the required field');
      else if ($("#text_field2").val() == "")
        $('#error_resp').text('please fill the required field');
      else
        return true;
    });
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>