title: How can I encrypt password before submit?
body: <p>I'm making a login form in HTML and the backend with PHP</p>
  <p>this is the form</p>
  <pre><code>&lt;form class=&quot; col-md-8&quot; action=&quot;inicio.php&quot; method=&quot;POST&quot; onsubmit=&quot;encrypt()&quot;&gt;
  &lt;br&gt;
  &lt;p&gt;&lt;?php echo $error; ?&gt;&lt;/p&gt;
   &lt;div class=&quot;mt-3&quot;&gt;
    &lt;h5&gt;&lt;label for=&quot;materialLoginFormEmail&quot;&gt;USUARIO&lt;/label&gt;&lt;/h5&gt;
    &lt;input type=&quot;text&quot; id=&quot;user&quot; name=&quot;username&quot; class=&quot;form-control&quot; required=&quot;true&quot; placeholder=&quot;Introduce tu usuario&quot;&gt;       
   &lt;/div&gt;
  &lt;br&gt;
   &lt;div&gt;
    &lt;h5&gt;&lt;label for=&quot;materialLoginFormPassword&quot;&gt;CONTRASEÑA&lt;/label&gt; &lt;/h5&gt;
    &lt;input type=&quot;password&quot; class=&quot;form-control&quot; required=&quot;true&quot; id=&quot;password&quot; name=&quot;password&quot; value=&quot;&quot; placeholder=&quot;Introduce tu contraseña&quot;&gt;
   &lt;/div&gt;
   &lt;div class=&quot;d-flex justify-content-around&quot;&gt;
    &lt;div&gt;
     &lt;button class=&quot;btn my-4&quot; name =&quot;btnLogin&quot; type=&quot;submit&quot; style=&quot;background-color: rgba(78,133,172);  color: white;&quot;&gt;Iniciar Sesión&lt;/button&gt;
    &lt;/div&gt;
   &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  <p>When I clicked on the submit button in the network request appears this <a href="https://i.stack.imgur.com/5T24J.png" rel="nofollow noreferrer">password is showed</a></p>
  <p>Can I encrypt that field or hide?</p>