How to make a hidden input field in Bootstrap Form

Do this exactly like in plain HTML.

Just make a normal input with hidden type. You don’t have to append any extra class to this input, because it’s hidden anyway.

<input type="hidden" name="myHiddenInput" value="">

Full example:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Snippetsdb.com example</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
  </head>
  <body>

  <form method="POST" action="">
    <b>Nickname:</b>
    <input type="text" class="form-control mt-2" name="nickname">
    <input type="hidden" name="securityCode" value="n4NBHu2GpOzjyTOgVmgF3QaS881q084e">
    <button class="btn btn-success w-100 mt-2" type="submit">Submit</button>
    <input type="hidden" name="myHiddenInput" value="">
  </form>

    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
  </body>
</html>