title: Submit button in Joomla module not work
body: <p>Please advise how to solve Joomla! issue.
  In the PHP file outside Joomla! <strong>Submit</strong> button works perfect and starts <strong>POST</strong> method to send data to the DB.
  When I have created Joomla! module with exactly the same code inside, covered with {source}{/source} tags and after fill the form, I get following error message in console:</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-js lang-js prettyprint-override"><code>&lt; div class = "g-block size-100" &gt;
    &lt;div id = "custom-8642-particle"
  class = "g-content g-particle" &gt; &lt; h2 class = "g-title" &gt; We are sorry! &lt; /h2&gt; &lt;
    p &gt; Gantry 5 provides a custom error page
  for you to configure with either positions, particles or a combination of both, as well as styling. &lt; /p&gt; &lt;
    /div&gt;</code></pre>
  </div>
  </div>
  
  PHP file code worked outside of Joomla! and provided this error is here:</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;?php
  require_once ("pg_conn.php");
  if (isset ( $_POST ['submit'] )) {
      $elem = $_POST;
      foreach ( $elem as $key =&gt; $value ){
      }
      unset ( $elem ['submit'] );
      $res = pg_insert ( $dbconn, 'test.tb_54646', $elem );
      if ($res) {
          echo "Record completed";
      } else {
          echo "NOT completed";
      }
  }
  ?&gt;
  
    &lt;!DOCTYPE html&gt;
    &lt;html&gt;
  
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;&lt;/title&gt;
  
      &lt;script&gt;
        function sendForm(form) {
          form.submit();
        }
      &lt;/script&gt;
  
    &lt;/head&gt;
  
    &lt;body&gt;
      &lt;table&gt;
        &lt;tbody&gt;
          &lt;form method="post" action="area.php"&gt;
  
            &lt;tr&gt;
              &lt;td&gt;&lt;label for="street"&gt;Street:&lt;/label&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="street" onchange="sendForm(this.form)"&gt;&lt;/td&gt;
            &lt;/tr&gt;
  
            &lt;tr&gt;
              &lt;td&gt;&lt;label for="building_no"&gt;Building No:&lt;/label&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="bld_no"&gt;&lt;/td&gt;
            &lt;/tr&gt;
  
            &lt;tr&gt;
              &lt;td&gt;&lt;label for="ID Sector"&gt;ID Sector:&lt;/label&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="id_sector"&gt;&lt;/td&gt;
            &lt;/tr&gt;
            ------------------
            &lt;tr&gt;
              &lt;td&gt;&lt;input type="reset" name="reset" value="Clear It"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="submit" onClick="return nodata(this.form)" name="submit" value="Submit"&gt; &lt;/td&gt;
            &lt;/tr&gt;
          &lt;/form&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/body&gt;
  
    &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>`</p>