β›”HTML input: hidden

allowing a programmer to include hidden information upon form submission

Essentials

In a form, an <input> tag with a type="hidden" would usually not appear on the form interface but remain in the background:

<form action="destination.html" method="post">
  
  <input type="hidden" name="cantsee" value="this">
  
  <div>
    <label for="fname">First name</label>
    <input type="text" name="fname" id="fname">
  </div>
  
  ...

  <div>
    <input type="reset">
    <input type="submit" value="Go!"> 
  </div>
  
</form>

Takeaways

  • When the form submits, it will send the hidden field with cantsee=this as a key and value data pair

Last updated